diff --git a/Cocoa/Document.m b/Cocoa/Document.m index ea307fb..3aec220 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -126,6 +126,7 @@ static uint32_t rgbEncode(GB_gameboy_t *gb, uint8_t r, uint8_t g, uint8_t b) GB_run(&gb); } [self.audioClient stop]; + self.audioClient = nil; self.view.mouseHidingEnabled = NO; GB_save_battery(&gb, [[[self.fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"sav"] UTF8String]); stopping = false; diff --git a/Cocoa/GBShader.m b/Cocoa/GBShader.m index 200d077..63bfaac 100644 --- a/Cocoa/GBShader.m +++ b/Cocoa/GBShader.m @@ -160,6 +160,10 @@ void main(void) {\n\ glDeleteProgram(program); glDeleteTextures(1, &texture); glDeleteTextures(1, &previous_texture); + + /* OpenGL is black magic. Closing one view causes others to be completely black unless we reload their shaders */ + /* We're probably not freeing thing in the right place. */ + [[NSNotificationCenter defaultCenter] postNotificationName:@"GBFilterChanged" object:nil]; } + (GLuint)shaderWithContents:(NSString*)contents type:(GLenum)type