Commit 2c0ea2ff authored by David Fuhrmann's avatar David Fuhrmann

macosx: Implement different way to always store playback position

The previous solution caused different problems. Therefore,
add this as a workaround to deinitialize InputManager, even if
the object still has strong references and therefore cannot be
destroyed yet.

The comment explains some problems, which look like not easily
fixable for the 3.0 branch.

close #19704
parent bbae6326
......@@ -32,6 +32,7 @@
@interface VLCInputManager : NSObject
- (id)initWithMain:(VLCMain *)o_mainObj;
- (void)deinit;
- (void)inputThreadChanged;
......@@ -186,7 +186,14 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
return self;
- (void)dealloc
* TODO: Investigate if this can be moved to dealloc again. Current problems:
* - dealloc might be never called of this object, as strong references could be in the
* (already stopped) main loop, preventing the refcount to go 0.
* - Calling var_DelCallback waits for all callbacks to finish. Thus, while dealloc is already
* called, callback might grab a reference to this object again, which could cause trouble.
- (void)deinit
msg_Dbg(getIntf(), "Deinitializing input manager");
if (p_current_input) {
......@@ -328,6 +328,7 @@ static VLCMain *sharedInstance = nil;
b_intf_terminating = true;
[_input_manager onPlaybackHasEnded:nil];
[_input_manager deinit];
if (notification == nil)
[[NSNotificationCenter defaultCenter] postNotificationName: NSApplicationWillTerminateNotification object: nil];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment