[webkit-reviews] review requested: [Bug 20483] WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?) : [Attachment 23345] Add and use smart pointers for glib memory management

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 11 06:39:06 PDT 2008


Marco Barisione <marco.barisione at collabora.co.uk> has asked  for review:
Bug 20483: WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?)
https://bugs.webkit.org/show_bug.cgi?id=20483

Attachment 23345: Add and use smart pointers for glib memory management
https://bugs.webkit.org/attachment.cgi?id=23345&action=edit

------- Additional Comments from Marco Barisione
<marco.barisione at collabora.co.uk>
- Add GOwnPtr, it behaves like OwnPtr but frees the memory using g_free (or
different functions if the glib structs need to be freed with something else).
- Add GRefPtr, it behaves like RefPtr but uses g_object_ref/unref (or other
functions if needed).
- I didn't add a GPassRefPtr as its use would be very limited.
- The private data of GObjects exported by WebKit GTK are now correctly
initialised and destroyed. I had to use placement new and calling directly the
destructor as the memory is allocated and destroyed by GLib so we cannot call
new/delete.
- Switched the existing code to use the new smart pointers.


More information about the webkit-reviews mailing list