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



On Thursday 12 June 2014 09:26:35 Andreas Winkelmann wrote:

Hi David.

On Saturday 07 June 2014 10:50:59 David King wrote:

I have tidied up and pushed the first and second patches to a
wip/awinkelmann branch. I find it quite easy to trigger a warning when
toggling between browser modes (file list or album/artist list). If I
select a file in the file list, then switch mode and then switch back to
the file list, I can trigger the warning:

** (easytag:3333): CRITICAL **: Action_Select_Browser_Style: assertion
'ETCore->ETFileDisplayedList != NULL' failed

I do not have much time to look into the problem at the moment, but
hopefully a simple change will be enough to fix it.

Oh, damn ;-)

I think I have found the reason.

Happens if there is more than one album in the Browser List and you switch
to Album/Artist List.

----------------------------------------------------------------------------
----------------------- GList *ET_Displayed_File_List_By_Etfile (ET_File
*ETFile)
{
    GList *etfilelist;

    for (etfilelist = ET_Displayed_File_List_First (); etfilelist != NULL;
         etfilelist = ET_Displayed_File_List_Next ())
    {
        if (ETFile == (ET_File *)etfilelist->data)
            break;
    }
    ETCore->ETFileDisplayedList = etfilelist; // To "save" the position like
in ET_File_List_Next... (not very good - FIX ME)
    return etfilelist;
}
----------------------------------------------------------------------------
-----------------------

If the for-loop does not find the ETFile - given via argument - after the
for- loop etfilelist is NULL but set to ETCore->ETFileDisplayedList and
trashes the already stored List. This seems to cause the trouble.

At the moment I am not sure why even this value has to be "saved". And the
Text "(not very good - FIX ME)" looks also strange ;-)

A "if(etfilelist)..." fixes the bug.

But I will try to get a better understanding what happens to get a final
solution.

Ok, I think I got this fixed.

A patch is attached.

Once more the GTKTreeSelection "changed" signal caused some Trouble. It gets 
emitted for each row while gtk_list_store_clear() clears the BrowserList. I 
have stopped invoking Browser_List_Row_Selected() while this happens.

-- 
Andreas

Attachment: 0001-Fixes-problems-with-an-assertion-in-Action_Select_Br.patch
Description: Text Data



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