paragui-dev
[Top][All Lists]
Advanced

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

Re: [paragui-dev] shutdown deletes objects twice


From: Martin Bickel
Subject: Re: [paragui-dev] shutdown deletes objects twice
Date: Sat, 11 Jun 2005 23:18:01 +0200

On Sat, 11 Jun 2005 17:25:30 +0200, Alexander Pipelka wrote:

>I found that the problem is *not* inside the destructor of PG_DropDown
>but in the shutdown procedure of PG_Application. The loop prereads the
>pointer to the next object in the list. If a PG_DropDown object gets
>removed, the destructor will delete and remove the ListBox object (the
>next in the list). The next iteration in the shutdown loop will try to
>delete the invalid pointer,.... bang.
>
>The attached patch fixes this problem (Checked with valgrind).
>
>Please reverse my previous patch and apply this one.

While this patch seems to fix the above mentioned bug, the double
deletion for the DropList still exists. I'm wondering why valgrind
didn't find it on your system...

>> What do you think of the following solution:
>> 
>> Adding a signal "sigDelete" to PG_Widget which is called by the
>> destructor of PG_Widget.
>> The DropDown-Menu could then hook that signal of its DropList  and set
>> the my_DropList variable to NULL if it is fired.
>Hopefully not needed anymore.

I've implemented this solution. Here comes the patch (which also adds a
small piece of documentation to pgscrollbar). The dropdown test now
runs flawlessly, so I recommend applying both patches.

Martin


Attachment: pgdrop.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]