diff options
Diffstat (limited to 'macosx/plugins/DFXVideo/macsrc/PluginGLView.m')
| -rwxr-xr-x | macosx/plugins/DFXVideo/macsrc/PluginGLView.m | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m index c157e499..a3dda640 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m @@ -57,6 +57,10 @@ extern time_t tStart; } else if (oglProfile == NSOpenGLProfileVersion3_2Core) { [self cleanupGL3]; } + + if (image_base) { + free(image_base); + } } - (BOOL)isOpaque @@ -174,16 +178,19 @@ extern time_t tStart; } } -- (char*)loadSource:(NSURL *)filename ++ (char*)loadSource:(NSURL *)filename { //Since we're passing Cocoa NSURLs, let's use Cocoa's methods if (filename == nil) { return NULL; } - NSMutableData *shaderData = [NSMutableData dataWithContentsOfURL:filename]; + + NSUInteger len; + NSMutableData *shaderData = [[NSMutableData alloc] initWithContentsOfURL:filename]; [shaderData appendBytes:"\0" length:1]; - char *shaderText = malloc([shaderData length]); - [shaderData getBytes:shaderText length:[shaderData length]]; + len = [shaderData length]; + char *shaderText = malloc(len); + [shaderData getBytes:shaderText length:len]; return shaderText; } |
