# HG changeset patch # User Jacob Carlborg # Date 1244325892 -7200 # Node ID 64712e72cb16c413ce5cf87dc3c06a4e5e9e060b # Parent 05e03d23ca3a0cce35814ef78695adf3dd96394c Fixes #32 diff -r 05e03d23ca3a -r 64712e72cb16 dwt/internal/cocoa/NSWorkspace.d --- a/dwt/internal/cocoa/NSWorkspace.d Sat Jun 06 23:35:37 2009 +0200 +++ b/dwt/internal/cocoa/NSWorkspace.d Sun Jun 07 00:04:52 2009 +0200 @@ -59,7 +59,7 @@ } public bool getInfoForFile(NSString fullPath, ref objc.id appName, ref objc.id type) { - return OS.objc_msgSend_bool(this.id, OS.sel_getInfoForFile_application_type_, fullPath !is null ? fullPath.id : null, appName, type); + return OS.objc_msgSend_bool(this.id, OS.sel_getInfoForFile_application_type_, fullPath !is null ? fullPath.id : null, &appName, &type); } public NSImage iconForFile(NSString fullPath) { diff -r 05e03d23ca3a -r 64712e72cb16 dwt/program/Program.d --- a/dwt/program/Program.d Sat Jun 06 23:35:37 2009 +0200 +++ b/dwt/program/Program.d Sun Jun 07 00:04:52 2009 +0200 @@ -83,8 +83,8 @@ NSAutoreleasePool pool = cast(NSAutoreleasePool) (new NSAutoreleasePool()).alloc().init(); try { NSWorkspace workspace = NSWorkspace.sharedWorkspace(); - objc.id appName = cast(objc.id) OS.malloc(C.PTR_SIZEOF); - objc.id type = cast(objc.id) OS.malloc(C.PTR_SIZEOF); + objc.id appName = new objc.objc_object; + objc.id type = new objc.objc_object; NSString temp = new NSString(OS.NSTemporaryDirectory()); NSString fileName = NSString.stringWith("swt" ~ Format("{}", System.currentTimeMillis()) ~ extension); NSString fullPath = temp.stringByAppendingPathComponent(fileName); @@ -92,10 +92,7 @@ fileManager.createFileAtPath(fullPath, null, null); workspace.getInfoForFile(fullPath, appName, type); fileManager.removeItemAtPath(fullPath, null); - objc.id buffer; - OS.memmove(buffer, appName, C.PTR_SIZEOF); - OS.free(appName); - OS.free(type); + objc.id buffer = appName; if (buffer !is null) { NSString appPath = new NSString(buffer); NSBundle bundle = NSBundle.bundleWithPath(appPath);