Re: Segmentation fault in code - possible bug?



Sorry,
Got some help - it isn't a bug. 

Needed to use a different signal function, one that disconnects
after the widget specified is destroyed.

i.e. g_signal_connect_object

Thanks to the guys on #gtk+

All makes perfect sense now.

Joe


P.S. Learnt lots because of it!

On Fri, Feb 06, 2004 at 06:18:37PM +0000, John Cupitt wrote:
> Hi Joe,
> 
> Joseph Turner wrote:
> >When I run the resulting program and press the button at the top of the 
> >window
> >it gets rid of the gtk_entry. If I keep pressing this button, I get a
> >segmentation fault.
> >
> >If I replace the entry widget with a button say, (and other code as well)
> >I can keep pressing the top button without any segmentation fault.
> 
> You shouldn't destroy a widget more than once: it's like free()ing 
> something twice. If it didn't fault with the button there instead of the 
> entry, it's only because you were very lucky :-)
> 
> John

-- 



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