com.moesol.bindings.platform_sdk.windows_api
Class NativeResourceRef

java.lang.Object
  extended by java.lang.ref.Reference
      extended by java.lang.ref.PhantomReference
          extended by com.moesol.bindings.platform_sdk.windows_api.NativeResourceRef
All Implemented Interfaces:
NativeResourceChecker

public class NativeResourceRef
extends PhantomReference
implements NativeResourceChecker

Check for native handle leaks. A handle is any java object which holds a native pointer.


Method Summary
 void check()
          This method is called by NativeLeakChecker thread when objects implementing this interface are dequed.
static long getLeakCount()
           
static boolean recordCreateLocation(Object holder, long native_handle)
          call from assert always returns true
static boolean removeCreateLocation(long native_handle)
          call from assert always returns true
 
Methods inherited from class java.lang.ref.PhantomReference
get
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, isEnqueued
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

recordCreateLocation

public static boolean recordCreateLocation(Object holder,
                                           long native_handle)
call from assert always returns true


removeCreateLocation

public static boolean removeCreateLocation(long native_handle)
call from assert always returns true


check

public void check()
Description copied from interface: NativeResourceChecker
This method is called by NativeLeakChecker thread when objects implementing this interface are dequed.

Specified by:
check in interface NativeResourceChecker

getLeakCount

public static long getLeakCount()


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.