LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-28-2009, 02:04 PM   #1
fullqvrdad
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?
 
  


Reply

Tags
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


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

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