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



On 05/25/2014 06:50 PM, David King wrote:

Hi David.

The cause were the interaction between the Lists for the Albums and
Artists and the Pointers to them stored in the List Stores. Actually
these lists get freed but not removed from the List Stores. So there
were some dangling pointers around. Which were accessed with some gtk
row-changed signals.

While digging in these places to find the reason for my crashes I found
a memory leak. The Lists added to the "<All Albums>" Rows were not
free()'d. Also fixed with the attached patch.

Furthermore some minor issues.

I am travelling at the moment, so I will probably not be able to look at the patch this week, but could you split up the patch into one per problem, so that it is easier to review?


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.


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


I have cleaned things up ;-)

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.

--
Andreas

Attachment: 0001-Fixed-a-few-crashes-because-of-dangling-pointers.patch
Description: Text Data

Attachment: 0002-Fixed-a-memory-leak.patch
Description: Text Data

Attachment: 0003-Some-cosmetic-changes-Browser_List_Refresh_File_In_L.patch
Description: Text Data



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