protected virtual void FreeHandle() { if (type < OciHandleType.LobLocator) { switch (type) { case OciHandleType.Bind: case OciHandleType.Define: // Bind and Define handles are freed when Statement handle is disposed break; case OciHandleType.Environment: if (handle != IntPtr.Zero) { OciCalls.OCIHandleFree(handle, type); } break; default: if (handle != IntPtr.Zero && parent != null && parent.Handle != IntPtr.Zero) { OciCalls.OCIHandleFree(handle, type); } break; } handle = IntPtr.Zero; } }