Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Glade
  • » [Glade-devel] dispose, finalize and close_impl methods not been called for glade_project [RSS Feed]

#1 Jan. 11, 2011 10:18:06

Tristan V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Glade-devel] dispose, finalize and close_impl methods not been called for glade_project


On Tue, 2011-01-11 at 01:22 -0300, Marco Diego Aurélio Mesquita wrote:
> Hi devs!
>
> I'm working on some improvements for the preview feature but I got
> stuck. Glade must kill current running previews when a project is
> closed, but, I don't know why, the finalize, dispose, and close_impl
> methods are not been called. What is happening? What should I do?
>
> The attached is part of my ongoing work on this issue. It's full of
> debug printf's but shows that the finalize, dispose, and close_impl
> methods are not been called.
>

I looked at the patch briefly, currently it still includes
unneeded functions like glade_preview_kill_preview().

- glade_preview_kill_preview() should be an implied exercise
by way of finalizing a GladePreview.
- The hash table bookkeeping the running previews should
hold the reference to the previews (i.e. the GDestroyNotify
for the hash table of previews should be g_object_unref).
- glade_preview_add_watch() should go away and the watch should
be added internally by the preview object, and destroyed
properly when the preview is unreffed.
- If the preview is notified that the child preview process
died, it should emit a "die" signal so that the GladeProject
which owns the preview can use that to remove it from the
hash table, resulting in it's dispose/finalize.

Please deal with these basic API/functionality issues first,
if the ref counts dont balance after that I'll help you take
a look at it and make sure that it finalizes properly.

Hint:
From GladeProject creating a preview should be:

/* comes with initial ref */
preview = glade_preview_launch (...);

/* hash table takes a ref */
g_hash_table_insert (project->priv->preview_hash, preview...);

/* pass ownership of the preview to the hash table */
g_object_unref (preview);

/* Watch previews that die */
g_signal_connect (preview, "die",
G_CALLBACK (remove_preview_from_hash_cb),
project);


... furthermore, the GDestroyNotify for the preview hash should
be a function that first disconnects the "die" signal callback
and *then* unrefs the preview.

Cheers,
-Tristan

> https://bugzilla.gnome.org/show_bug.cgi?id=637835> _______________________________________________
> Glade-devel maillist - Glade-de***@*ists.ximian.com
>http://lists.ximian.com/mailman/listinfo/glade-devel_______________________________________________
Glade-devel maillist - Glade-devel@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/glade-devel

Offline

#2 Jan. 11, 2011 10:20:52

Tristan V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Glade-devel] dispose, finalize and close_impl methods not been called for glade_project


On Tue, 2011-01-11 at 19:25 +0900, Tristan Van Berkom wrote:
> On Tue, 2011-01-11 at 01:22 -0300, Marco Diego Aurélio Mesquita wrote:
> > Hi devs!
> >
> > I'm working on some improvements for the preview feature but I got
> > stuck. Glade must kill current running previews when a project is
> > closed, but, I don't know why, the finalize, dispose, and close_impl
> > methods are not been called. What is happening? What should I do?
> >
> > The attached is part of my ongoing work on this issue. It's full of
> > debug printf's but shows that the finalize, dispose, and close_impl
> > methods are not been called.
> >
>
> I looked at the patch briefly, currently it still includes
> unneeded functions like glade_preview_kill_preview().
>
> - glade_preview_kill_preview() should be an implied exercise
> by way of finalizing a GladePreview.
> - The hash table bookkeeping the running previews should
> hold the reference to the previews (i.e. the GDestroyNotify
> for the hash table of previews should be g_object_unref).
> - glade_preview_add_watch() should go away and the watch should
> be added internally by the preview object, and destroyed
> properly when the preview is unreffed.
> - If the preview is notified that the child preview process
> died, it should emit a "die" signal so that the GladeProject
> which owns the preview can use that to remove it from the
> hash table, resulting in it's dispose/finalize.
>
> Please deal with these basic API/functionality issues first,
> if the ref counts dont balance after that I'll help you take
> a look at it and make sure that it finalizes properly.
>
> Hint:
> From GladeProject creating a preview should be:
>
> /* comes with initial ref */
> preview = glade_preview_launch (...);
>
> /* hash table takes a ref */
> g_hash_table_insert (project->priv->preview_hash, preview...);
>
> /* pass ownership of the preview to the hash table */
> g_object_unref (preview);
>

Correction, you wouldn't need to unref the preview explicitly
here because above you give the initial ref to the hash table.

Cheers,
-Tristan

> /* Watch previews that die */
> g_signal_connect (preview, "die",
> G_CALLBACK (remove_preview_from_hash_cb),
> project);
>
>
> ... furthermore, the GDestroyNotify for the preview hash should
> be a function that first disconnects the "die" signal callback
> and *then* unrefs the preview.
>
> Cheers,
> -Tristan
>
> > https://bugzilla.gnome.org/show_bug.cgi?id=637835> > _______________________________________________
> > Glade-devel maillist - Glade-de***@*ists.ximian.com
> >http://lists.ximian.com/mailman/listinfo/glade-devel>
>
> _______________________________________________
> Glade-devel maillist - Glade-de***@*ists.ximian.com
>http://lists.ximian.com/mailman/listinfo/glade-devel_______________________________________________
Glade-devel maillist - Glade-devel@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/glade-devel

Offline

  • Root
  • » Glade
  • » [Glade-devel] dispose, finalize and close_impl methods not been called for glade_project [RSS Feed]

Board footer

Moderator control

Enjoy the 21st of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support