Changeset 108760 in webkit


Ignore:
Timestamp:
Feb 24, 2012 2:19:42 AM (12 years ago)
Author:
sergio@webkit.org
Message:

[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):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r108730 r108760  
     12012-02-24  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [WK2] [GTK] Destructor not invoked in EditorClientFrameDestructionObserver
     4        https://bugs.webkit.org/show_bug.cgi?id=79466
     5
     6        Reviewed by Philippe Normand.
     7
     8        Explicitly cast the observer before deleting it instead of just
     9        deleting a generic pointer. We must to that in order to get the
     10        destructor of the object properly called.
     11
     12        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
     13        (WebKit::EditorClientFrameDestructionObserver::destroyOnClosureFinalization):
     14
    1152012-02-23  Andy Estes  <aestes@apple.com>
    216
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp

    r108631 r108760  
    149149    GClosure* m_closure;
    150150
    151     static void destroyOnClosureFinalization(gpointer data, GClosure* closure) { delete data; }
     151    static void destroyOnClosureFinalization(gpointer data, GClosure* closure)
     152    {
     153        // Calling delete void* will free the memory but won't invoke
     154        // the destructor, something that is a must for us.
     155        EditorClientFrameDestructionObserver* observer = static_cast<EditorClientFrameDestructionObserver*>(data);
     156        delete observer;
     157    }
    152158};
    153159
Note: See TracChangeset for help on using the changeset viewer.