diff options
author | dynaflash <[email protected]> | 2011-08-18 22:11:49 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2011-08-18 22:11:49 +0000 |
commit | c940d50b267c06d669dd068ece3b0baa5309a320 (patch) | |
tree | 48e980d2cf01c5542b03577e7cc383033c5ad92c /macosx/HBPreviewController.m | |
parent | f1e686af3a262170e071a3bddbd7661bf956c7b9 (diff) |
MacGui: Fix crash when launching then cancelling new source and quitting would cause a crash due to there being no preview when calling windowWillClose in HBPreview.m
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4185 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPreviewController.m')
-rw-r--r-- | macosx/HBPreviewController.m | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m index 9e4e2f6f6..adacb8bf1 100644 --- a/macosx/HBPreviewController.m +++ b/macosx/HBPreviewController.m @@ -125,12 +125,18 @@ - (void)windowWillClose:(NSNotification *)aNotification { - /* Upon Closing the picture window, we make sure we clean up any - * preview movie that might be playing or encoding + /* Upon closing the preview window, we make sure we clean up any + * preview movie that might be playing or encoding. However, first + * make sure we have a preview picture before calling pictureSliderChanged + * to go back to still previews .. just in case nothing is loaded up like in + * a Launch, cancel new scan then quit type scenario. */ - [self pictureSliderChanged:nil]; - [fMovieTimer invalidate]; - [fMovieTimer release]; + if (fPicture) + { + [self pictureSliderChanged:nil]; + [fMovieTimer invalidate]; + [fMovieTimer release]; + } hudTimerSeconds = 0; [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"PreviewWindowIsOpen"]; |