On Tue, Dec 06, 2005 at 08:54:37AM -0600, Brian Mattern wrote:
> On Tuesday 06 December 2005 08:05, Falko Schmidt wrote:
> > Hi,
> >
> > I'm stuck here with some ewl-related problems since several days.
> >
> > First, there's an issue with a configuration interface that I'm trying
> > to write. I think the easiest way is to describe my intension:
> >
> > I hope it isn't too confusing.
> >
> > I've got a main window that spawns a new window in which I can specify
> > one configuration type from a menu (currently imenu, more on that
> > later). Depending on the type chosen several spinners, checkboxes,
> > descriptions etc. are created in the same window using several globally
> > defined widgets. Those are used to define the parameters to the
> > configuration option chosen above. Each option has different amounts of
> > spinners, checkboxes and so on.
> > If, once I chose one option from the menu, choose another option, the
> > old spinners and checkboxes are destroyed and replaced by the new
> > widgets (which works because they are globally defined). All that works
> > quite well. But if I close that window to go back to the parent window
> > and then open it again, choosing from the menu the first time would
> > crash the program. With gdb I found out that it was caused by the
> > ewl_widget_destroy which removes any previous widgets to make place for
> > the newly chosen option's widgets.
> > I tried to find out a reason for this but wasn't successful. Is this a
> > known issue or is my concept not realizable in the end? I would like to
> > keep the configuration window small by only showing the needed parameter
> > input fields for one specific option instead of all at once.
> >
> 
> I'm not positive, as I haven't seen your code, but I would guess that you are 
> not setting your widget pointers to NULL after deleting them. On type change, 
> it deletes and immediately reassigns new values, so the next delete is 
> successful. However, when you close the window completely, only the deletes 
> happen, and you are left with a bunch of pointers to freed memory. Then, upon 
> type selection, you try to delete them again, accessing the freed memory, 
> causing a segv.
> 
> So, you probably just need to set them to NULL after delete.
> 
> Again, just a guess :)
> --
> rephorm

Ooooh, true. That could really be the reason. Thanks a lot! I'll try it
as soon as menu and/or imenu work again.

Thanks again,

Falko


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to