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?
|