Re: [PATCH] Fixed some Crashes, a memory leak and some minor issues



Hi Andreas

On 2014-05-26 19:02, Andreas Winkelmann <ml awinkelmann de> wrote:
You're right, the patch was a collection of almost all things I did
while hunting for the crash ;-) Better to split these.
Now I have created three separate patches.

Thanks! I might have time to review them this week, but I cannot promise anything.

There seem to be some whitespace changes, which should be removed.

I have cleaned things up ;-)

Glad to hear that, thank you.

I do not think that the g_object_unref() changes are correct, as a
GtkListStore inherits from GObject, not GtkWidget (and, more
importantly, does not inherit from GInitiallyUnowned). Therefore, it
starts with a reference count of 1, which is increased by 1 when
adding it to a GtkTreeView. The result of this is that when destroying
the tree views, the models will not be finalized.

Hmm, I didn't want to skip these unref's comletely. It's just the place
which seems to be wrong. If we unref something we shouldn't use it
anymore? But we are storing the variables and use them until ET ends. I
think it would be better to place these unrefs short before destroying
the Widgets.

Not quite, because the unref does not lead to finalization (destruction) until the reference count drops to 0. The model pointer should be kept inside the parent object, and not exposed as a global variable in order to avoid dereferencing it when the object has been disposed. I have made much progress towards this goal in the wip/application-window branch:

https://git.gnome.org/browse/easytag/commit/?h=wip/application-window&id=553d689845905b765efe2a4f3c136b4a32ff0aa3

The above commit stores the models inside a new browser object, although the branch is not complete yet. It is convenient to use the same object lifecycle conventions as other GObject applications, although this will take a bit more time to get completely right.

--
http://amigadave.com/

Attachment: signature.asc
Description: Digital signature



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