Re: Gtk::SpinButton crash



Hi John,
Hope you don't mind me jumping in. I'm curious why you want to do your own memory management: Gtk::manage takes all the work out of your hands safely, and stops you deleting widgets in an inappropriate order. If you want to make a program that you have to do all your memory management manually, C is probably a better choice- but if you work at it you can manage it in C++. It's a bit archaic, though, and the only use I can see for it is a teaching exercise (to make sure you never want to do it again).

Program size isn't a good excuse; if you're that desperate you should be using C. So why bother?

Ian

On 26/11/13 10:05, John Emmas wrote:
Hi Kjell,

Many thanks for sending me your versions of those files. The good news is that with only the exception of some commented sections, your versions are identical to mine. Both versions exhibit the same behaviour (and unfortunately, the same problems).

I'm wondering now if I've been fooling myself to think that this SpinButton/Adjuster issue is somehow related to the previous one that got solved. For various reasons it does look a bit similar - but I'm now starting to think that the SpinButton/Adjuster problem is actually a clearly defined issue in its own right. The reason I'm wondering is that this sequence crashes:-

        Create a SpinButton
        Create an Adjustment
        Attach the Adjustment to the SpinButton
        Delete the Adjustment
Delete the SpinButton // Remember that the (deleted) Adjustment is still attached !!

OTOH this sequence doesn't crash:-

        Create a SpinButton
        Create an Adjustment
        Attach the Adjustment to the SpinButton
        Delete the SpinButton  // Adjustment hasn't been deleted yet !!
        Delete the Adjustment

But wait a minute... during my tests I discovered some evidence to suggest that this sequence wouldn't crash either:-

        Create a SpinButton
        Create an Adjustment
        Attach the Adjustment to the SpinButton
Detach the Adjustment (using 'Gtk::SpinButton::unset_adjustment()')

        Delete the Adjustment  // These two deletions can now
        Delete the SpinButton   // get done (safely) in either order

So I guess I'm questioning the safety of deleting a Gtk::SpinButton whilst it has an (invalid) Gtk::Adjustment attached. I don't know enough about the gtkmm spec to know whether that should (or should not) be safe. It certainly isn't safe at present, from what I can tell. Would it help for me to try the same thing with a plain GTK+ app? If it's safe to do with GTK+ I'd assume it should also be safe with gtkmm....

John
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list



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