diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-03-03 19:50:59 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-03-03 19:50:59 +0000 |
| commit | 5660e3f37355999b2877ffbdde86794f2ea2e33d (patch) | |
| tree | 33764b49f92b35b2111895d3cb30b997cdfe3306 /macosx/plugins/DFXVideo/macsrc/PluginGLView.m | |
| parent | bc21097f4380f1b62ace949f1f766ceacbcc7c59 (diff) | |
| download | pcsxr-5660e3f37355999b2877ffbdde86794f2ea2e33d.tar.gz | |
OS X fiddling
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@89254 e17a0e51-4ae3-4d35-97c3-1a29b211df97
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; } |
