LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   GObject finalize not being called (http://www.linuxquestions.org/questions/programming-9/gobject-finalize-not-being-called-700593/)

fullqvrdad 01-28-2009 03:04 PM

GObject finalize not being called
 
I've added private data registered a finalize function for my custom GObject in the class_init function, but the finalize function is never being called to allow me to clean up my resources.

Here is the class_init() function:

void mid_platform_svc_class_init(MIDPlatformSvcClass *klass)
{
GObjectClass* parentClass = G_OBJECT_CLASS(klass);
parentClass->finalize = mid_platform_svc_finalize;
g_type_class_add_private(parentClass, sizeof(MIDPlatformSvcPrivate));
}

Here is the finalize function:

void mid_platform_svc_finalize(GObject *obj)
{
MIDPlatformSvc* self = MID_PLATFORM_SVC(obj);
MIDPlatformPrivate* priv = MIDPLATFORMSVC_GET_PRIVATE(self);
G_OBJECT_CLASS (mid_platform_svc_parent_class)->finalize(obj);
}

Everything compiles (finally!) but the finalize function is never being called. Anyone know what I am missing?


All times are GMT -5. The time now is 05:50 AM.