Commit 29c7471a authored by Felix Paul Kühne's avatar Felix Paul Kühne

mac plugin: prevent runtime exception

parent d2628c38
...@@ -183,6 +183,7 @@ VlcPluginMac::VlcPluginMac(NPP instance, NPuint16_t mode) : ...@@ -183,6 +183,7 @@ VlcPluginMac::VlcPluginMac(NPP instance, NPuint16_t mode) :
VlcPluginMac::~VlcPluginMac() VlcPluginMac::~VlcPluginMac()
{ {
[(VLCPerInstanceStorage *)_perInstanceStorage release]; [(VLCPerInstanceStorage *)_perInstanceStorage release];
_perInstanceStorage = nil;
} }
void VlcPluginMac::set_player_window() void VlcPluginMac::set_player_window()
...@@ -550,9 +551,13 @@ bool VlcPluginMac::handle_event(void *event) ...@@ -550,9 +551,13 @@ bool VlcPluginMac::handle_event(void *event)
[CATransaction begin]; [CATransaction begin];
[aLayer removeFromSuperlayer]; [aLayer removeFromSuperlayer];
[CATransaction commit]; [CATransaction commit];
VLCPerInstanceStorage *storage = (VLCPerInstanceStorage *)_cppPlugin->_perInstanceStorage;
if ([(VLCPerInstanceStorage *)_cppPlugin->_perInstanceStorage playbackLayer] == aLayer) if (storage != nil) {
[(VLCPerInstanceStorage *)_cppPlugin->_perInstanceStorage setPlaybackLayer:nil]; if ([storage respondsToSelector:@selector(setPlaybackLayer:)]) {
[storage setPlaybackLayer:nil];
}
}
} }
- (CGSize)currentOutputSize - (CGSize)currentOutputSize
......
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