From 30d9a9c791d4ace7b861b91b349ffb903859f2db Mon Sep 17 00:00:00 2001 From: "sergio@webkit.org" Date: Fri, 24 Feb 2012 10:19:42 +0000 Subject: [PATCH] [WK2] [GTK] Destructor not invoked in EditorClientFrameDestructionObserver https://bugs.webkit.org/show_bug.cgi?id=79466 Reviewed by Philippe Normand. Explicitly cast the observer before deleting it instead of just deleting a generic pointer. We must to that in order to get the destructor of the object properly called. * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::EditorClientFrameDestructionObserver::destroyOnClosureFinalization): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108760 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebKit2/ChangeLog | 14 ++++++++++++++ .../WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index 26efb40..b714096 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,17 @@ +2012-02-24 Sergio Villar Senin + + [WK2] [GTK] Destructor not invoked in EditorClientFrameDestructionObserver + https://bugs.webkit.org/show_bug.cgi?id=79466 + + Reviewed by Philippe Normand. + + Explicitly cast the observer before deleting it instead of just + deleting a generic pointer. We must to that in order to get the + destructor of the object properly called. + + * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: + (WebKit::EditorClientFrameDestructionObserver::destroyOnClosureFinalization): + 2012-02-23 Andy Estes Rename [setS|s]uppressIncrementalRendering to [setS|s]uppressesIncrementalRendering and make it WebPreferences API. diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp index 62622a6..9f34530 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp @@ -148,7 +148,13 @@ public: private: GClosure* m_closure; - static void destroyOnClosureFinalization(gpointer data, GClosure* closure) { delete data; } + static void destroyOnClosureFinalization(gpointer data, GClosure* closure) + { + // Calling delete void* will free the memory but won't invoke + // the destructor, something that is a must for us. + EditorClientFrameDestructionObserver* observer = static_cast(data); + delete observer; + } }; static Frame* frameSettingClipboard; -- 2.7.4