protected override void FreeObject(IntPtr ptr, bool disposing)
{
if (disposing)
{
// remove it from the list
RemoveContext(ptr);
}
if (this.usingDeprecatedAPI)
{
SafeNativeMethods.xnForceShutdown(ptr);
}
else
{
SafeNativeMethods.xnContextUnregisterFromShutdown(ptr, this.shutdownCallbackHandle);
SafeNativeMethods.xnContextRelease(ptr);
}
}