Add `IdleRegister` to deal with destruction while idle func is queued #3677

Merged
merged 2 commits into from Feb 13, 2017

Projects

None yet

4 participants

@Floessie
Collaborator
Floessie commented Feb 9, 2017

This adds a little helper class to guiutils.* that unregisters
in-flight idle functions queued by IdleRegister::add(). It's best
to call IdleRegister::destroy() in the destructor of the class
owning the IdleRegister instance. Otherwise make sure, it is the
last member which will be deleted first.

Resize now makes use of this new facility in setDimensions(), which
also fixes #3673.

@Floessie Floessie Add `IdleRegister` to deal with destruction while idle func is queued
This adds a little helper class to `guiutils.*` that unregisters
in-flight idle functions queued by `IdleRegister::add()`. It's best
to call `IdleRegister::destroy()` in the destructor of the class
owning the `IdleRegister` instance. Otherwise make sure, it is the
last member which will be deleted first.

`Resize` now makes use of this new facility in `setDimensions()`, which
also fixes #3673.
824ecae
@Floessie
Collaborator

@Hombre57 @heckflosse @Beep6581 That's it for this PR. Please test. Replacing gdk_threads(enter|leave)() in other places shouldn't be part of this PR, as #3673 needs to be fixed soon.

@Hombre57
Collaborator

@Floessie Very nice work ! But do you have some recommendations on how to test this branch ?

@Beep6581
Owner
Beep6581 commented Feb 12, 2017 edited

@Floessie I locally merged dev into idle_register and tested, found no issues.

@Floessie Floessie merged commit 6b6c080 into dev Feb 13, 2017
@Floessie Floessie deleted the idle_register branch Feb 13, 2017
@harshula
Contributor

@Floessie Thanks for fixing the crash so quickly! I tested a build with your patch. No crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment