Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-28-2009, 02:04 PM   #1
LQ Newbie
Registered: Jan 2009
Distribution: Moblin, Ubuntu, Fedora,
Posts: 1

Rep: Reputation: 0
Question 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?


glib, programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
what is closure and marshaller in gobject?? Dstruct0 Programming 0 08-22-2005 04:46 PM
Any body knows something about TypeNode in Gobject? phenix17 Programming 0 07-26-2005 11:18 AM
modem wont finalize kg4ysy Linux - Hardware 2 06-14-2005 10:06 PM
GLib-GObject-WARNING James Doutt Linux - Software 0 05-31-2005 07:24 PM
GLib-GObject-CRITICAL ERROR Gerardoj Linux - Software 0 07-05-2004 08:52 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration