Fwd: Memory leak in gobject

I have a doubt. Can you please clear it.
In this code segment, I think there is a memory leak.

int main(int argc, char** argv)



GObject * obj = (GObject *)g_object_new(G_TYPE_INITIALLY_UNOWNED , NULL);

if(obj->ref_count ==1)


g_object_unref (obj);


return 0;


The class structure which was created, when will that be destroyed? The Gtype's associated with these and how will that memory get destroyed.



If you are an eagle, don't waste time with chickens.....chickens cannot FLY.

umuntu ngumuntu ngabantu

"Take no pride in facts memorized, but in ideas grasped."—Chris Crawford

visit http://rupeemanager.blogspot.com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]