I doubt anyone will know the answer to this, as it's in 12+ year old code in the GTK2 module, but the destroy method (now renamed to _destruct) was explicitly checking that it received exactly zero args before calling gtk_object_destroy. Any idea why? Is there a situation in which destroy() might have been called with arguments, such that it shouldn't actually destroy anything?
I've removed the check, and now GTK2 apps correctly clean up their underlying objects when they're destroyed. But I'm hoping this hasn't reintroduced an old problem somewhere.
ChrisA
Chris Angelico wrote:
before calling gtk_object_destroy. Any idea why? Is there a situation in which destroy() might have been called with arguments, such that it shouldn't actually destroy anything?
I can only guess, but maybe it was being called explictly from some places in the code with a dummy argument to distinguish it from the real _destruct() called by Pike internals.
On Fri, Dec 22, 2017 at 9:49 PM, Stephen R. van den Berg srb@cuci.nl wrote:
Chris Angelico wrote:
before calling gtk_object_destroy. Any idea why? Is there a situation in which destroy() might have been called with arguments, such that it shouldn't actually destroy anything?
I can only guess, but maybe it was being called explictly from some places in the code with a dummy argument to distinguish it from the real _destruct() called by Pike internals.
Hmm. I can't find any, but that doesn't necessarily prove it. I'll keep an eye out for inexplicable GTK widget destruction as a potential clue.
ChrisA
Note that AFAIK destruct() in some GTK2 classes is a public function (and thus part of the API).
pike-devel@lists.lysator.liu.se