Bug 270146 [Mac] NSToolbar leak in CocoaUIEnhancer
bundles/org.eclipse.ui.cocoa/src/org/eclipse/ui/internal/cocoa/CocoaUIEnhancer.java
delegate.alloc().init();
            		
					Method method = OS.class.getMethod("NewGlobalRef", new Class[] { Object.class });
					Object object = method.invoke(OS.class, new Object[] {CocoaUIEnhancer.this});
					delegateJniRef = convertToLong(object);
            	} catch (Exception e) {
					
					
					log(e);
				}
        		if (delegateJniRef == 0) SWT.error(SWT.ERROR_NO_HANDLES);
				try {
					Field idField = SWTCocoaEnhancerDelegate.class.getField("id");
					Object idValue = idField.get(delegate);
					invokeMethod(OS.class, "object_setInstanceVariable",
							new Object[] { idValue,
									SWT_OBJECT, wrapPointer(delegateJniRef) });
					hookApplicationMenu();
					hookWorkbenchListener();
					
					display.disposeExec(new Runnable() {
						public void run() {
							if (delegateJniRef != 0) {
								try {
									invokeMethod(OS.class, "DeleteGlobalRef", new Object[] {wrapPointer(delegateJniRef)});
								} catch (Exception e) {
									
									
									log(e);
								}