public static bool UnregisterTabBar() { using (new Keychain(rwLockTabBar, true)) { QTTabBarClass tabbar; if (dictTabInstances.TryGetValue(Thread.CurrentThread, out tabbar)) { IntPtr handle = tabbar.Handle; dictTabInstances.Remove(Thread.CurrentThread); sdTabHandles.Remove(handle); ICommService service = GetChannel(); if (service != null) { service.DeleteInstance(handle); } } return(false); } }