On Sat, Dec 23, 2017 at 2:11 AM, Henrik Grubbström (Lysator) @ Pike (-) developers forum 10353@lyskom.lysator.liu.se wrote:
On Sat, Dec 23, 2017 at 12:42 AM, Henrik Grubbström (Lysator) @ Pike (-) developers forum 10353@lyskom.lysator.liu.se wrote:
Note that AFAIK destruct() in some GTK2 classes is a public function (and thus part of the API).
Do you mean destroy? It got renamed in the big _destruct rename, and
Yes, the LFUN got renamed. The GTK2 API function however did not.
it was because I'd been using it that I started poking around and finding this. But I'm quite okay with the API being "destruct(obj)" rather than "obj->destroy()", as long as it works reliably.
Using _destruct() for this kind of stuff is NOT a good idea as it gets called in a signal context.
Hmm. But there needs to be _something_ to cope with object abandonment, otherwise a long-running process risks leaking resources. So what SHOULD apps do? Not forgetting that an app may have to support multiple Pike versions (currently I try to support 7.8->8.1), so breaking changes have a cost.
ChrisA
Chris Angelico wrote:
On Sat, Dec 23, 2017 at 2:11 AM, Henrik Grubbstr??m (Lysator) @ Pike
Using _destruct() for this kind of stuff is NOT a good idea as it gets called in a signal context.
Hmm. But there needs to be _something_ to cope with object abandonment, otherwise a long-running process risks leaking resources. So what SHOULD apps do? Not forgetting that an app may have to support
I'd say, just doing it in _destruct() is fine, as long as you keep in mind that you should avoid things that could block on something. I.e. things that have to wait for a mutex which can block for an indetermined amount of time should not be done from _destruct(). Also, anything running from _destruct() should be thread-safe.
And with all the pike objects being referenced in the gtk2 object (and reverse), even if all the other objects are destroyed, if a pike object isn't, that is with gtk2, and that gtk2 object is a child in container, all it's parents will stay around too.
On Friday, December 22, 2017, 10:22:17 AM EST, Chris Angelico rosuav@gmail.com wrote:
On Sat, Dec 23, 2017 at 2:11 AM, Henrik Grubbström (Lysator) @ Pike (-) developers forum 10353@lyskom.lysator.liu.se wrote:
On Sat, Dec 23, 2017 at 12:42 AM, Henrik Grubbström (Lysator) @ Pike (-) developers forum 10353@lyskom.lysator.liu.se wrote:
Note that AFAIK destruct() in some GTK2 classes is a public function (and thus part of the API).
Do you mean destroy? It got renamed in the big _destruct rename, and
Yes, the LFUN got renamed. The GTK2 API function however did not.
it was because I'd been using it that I started poking around and finding this. But I'm quite okay with the API being "destruct(obj)" rather than "obj->destroy()", as long as it works reliably.
Using _destruct() for this kind of stuff is NOT a good idea as it gets called in a signal context.
Hmm. But there needs to be _something_ to cope with object abandonment, otherwise a long-running process risks leaking resources. So what SHOULD apps do? Not forgetting that an app may have to support multiple Pike versions (currently I try to support 7.8->8.1), so breaking changes have a cost.
ChrisA
So my destructor for an object should be called _destruct(), and not destroy()? What version did that change?
On Friday, December 22, 2017, 10:34:46 AM EST, Lance Dillon riffraff169@yahoo.com wrote:
And with all the pike objects being referenced in the gtk2 object (and reverse), even if all the other objects are destroyed, if a pike object isn't, that is with gtk2, and that gtk2 object is a child in container, all it's parents will stay around too.
On Friday, December 22, 2017, 10:22:17 AM EST, Chris Angelico rosuav@gmail.com wrote:
On Sat, Dec 23, 2017 at 2:11 AM, Henrik Grubbström (Lysator) @ Pike (-) developers forum 10353@lyskom.lysator.liu.se wrote:
On Sat, Dec 23, 2017 at 12:42 AM, Henrik Grubbström (Lysator) @ Pike (-) developers forum 10353@lyskom.lysator.liu.se wrote:
Note that AFAIK destruct() in some GTK2 classes is a public function (and thus part of the API).
Do you mean destroy? It got renamed in the big _destruct rename, and
Yes, the LFUN got renamed. The GTK2 API function however did not.
it was because I'd been using it that I started poking around and finding this. But I'm quite okay with the API being "destruct(obj)" rather than "obj->destroy()", as long as it works reliably.
Using _destruct() for this kind of stuff is NOT a good idea as it gets called in a signal context.
Hmm. But there needs to be _something_ to cope with object abandonment, otherwise a long-running process risks leaking resources. So what SHOULD apps do? Not forgetting that an app may have to support multiple Pike versions (currently I try to support 7.8->8.1), so breaking changes have a cost.
ChrisA
Lance Dillon wrote:
So my destructor for an object should be called _destruct(), and not destroy()??? What version did that change???
That will be in Pike 8.1 (and actually ended up in there about two months ago, I guess); so only relevant if you program for 8.1 as well.
pike-devel@lists.lysator.liu.se