< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsEnv.m

Print this page




 167  * Method:    deregisterDisplayReconfiguration
 168  * Signature: (J)V
 169  */
 170 JNIEXPORT void JNICALL
 171 Java_sun_awt_CGraphicsEnvironment_deregisterDisplayReconfiguration
 172 (JNIEnv *env, jobject this, jlong p)
 173 {
 174 JNF_COCOA_ENTER(env);
 175 
 176     JNFWeakJObjectWrapper *wrapper = (JNFWeakJObjectWrapper *)jlong_to_ptr(p);
 177     if (!wrapper) return;
 178 
 179     /* Remove the registration */
 180     if (CGDisplayRemoveReconfigurationCallback(&displaycb_handle, wrapper) != kCGErrorSuccess) {
 181         [JNFException raise:env
 182                          as:kInternalError
 183                      reason:"CGDisplayRemoveReconfigurationCallback() failed, leaking the callback context!"];
 184         return;
 185     }
 186 
 187     [wrapper setJObject:NULL withEnv:env]; // more efficiant to pre-clear
 188     [wrapper release];
 189 
 190 JNF_COCOA_EXIT(env);
 191 }


 167  * Method:    deregisterDisplayReconfiguration
 168  * Signature: (J)V
 169  */
 170 JNIEXPORT void JNICALL
 171 Java_sun_awt_CGraphicsEnvironment_deregisterDisplayReconfiguration
 172 (JNIEnv *env, jobject this, jlong p)
 173 {
 174 JNF_COCOA_ENTER(env);
 175 
 176     JNFWeakJObjectWrapper *wrapper = (JNFWeakJObjectWrapper *)jlong_to_ptr(p);
 177     if (!wrapper) return;
 178 
 179     /* Remove the registration */
 180     if (CGDisplayRemoveReconfigurationCallback(&displaycb_handle, wrapper) != kCGErrorSuccess) {
 181         [JNFException raise:env
 182                          as:kInternalError
 183                      reason:"CGDisplayRemoveReconfigurationCallback() failed, leaking the callback context!"];
 184         return;
 185     }
 186 
 187     [wrapper setJObject:NULL withEnv:env]; // more efficient to pre-clear
 188     [wrapper release];
 189 
 190 JNF_COCOA_EXIT(env);
 191 }
< prev index next >