Disposable: Emit 'wasDisposed' on destruction, not dispose()
Fixes segfaults when objects that were not explicitly disposed were collected by the GC.
This commit is contained in:
parent
b32d6c69cb
commit
3887342439
|
@ -70,9 +70,6 @@ RB_METHOD(disposableDispose)
|
|||
if (!c)
|
||||
return Qnil;
|
||||
|
||||
/* Inform core */
|
||||
c->wasDisposed();
|
||||
|
||||
disposableDisposeChildren(self);
|
||||
|
||||
delete c;
|
||||
|
|
|
@ -72,9 +72,6 @@ MRB_METHOD(disposableDispose)
|
|||
if (!c)
|
||||
return mrb_nil_value();
|
||||
|
||||
/* Inform core */
|
||||
c->wasDisposed();
|
||||
|
||||
disposableDisposeChildren(mrb, self);
|
||||
|
||||
delete c;
|
||||
|
|
|
@ -30,6 +30,11 @@
|
|||
class Disposable
|
||||
{
|
||||
public:
|
||||
~Disposable()
|
||||
{
|
||||
wasDisposed();
|
||||
}
|
||||
|
||||
sigc::signal<void> wasDisposed;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue