Esempio n. 1
0
GHOST_WindowSDL::~GHOST_WindowSDL()
{
	if (m_sdl_custom_cursor) {
		SDL_FreeCursor(m_sdl_custom_cursor);
	}

	releaseNativeHandles();

	SDL_DestroyWindow(m_sdl_win);
}
Esempio n. 2
0
GHOST_WindowWin32::~GHOST_WindowWin32()
{
	if (m_Bar) {
		m_Bar->SetProgressState(m_hWnd, TBPF_NOPROGRESS);
		m_Bar->Release();
	}

	if (m_wintab) {
		GHOST_WIN32_WTClose fpWTClose = (GHOST_WIN32_WTClose) ::GetProcAddress(m_wintab, "WTClose");
		if (fpWTClose) {
			if (m_tablet)
				fpWTClose(m_tablet);
			if (m_tabletData)
				delete m_tabletData;
			m_tabletData = NULL;
		}
	}

	if (m_customCursor) {
		DestroyCursor(m_customCursor);
		m_customCursor = NULL;
	}

	if (m_hWnd != NULL && m_hDC != NULL && releaseNativeHandles()) {
		::ReleaseDC(m_hWnd, m_hDC);
	}

	if (m_hWnd) {
		if (m_dropTarget) {
			// Disable DragDrop
			RevokeDragDrop(m_hWnd);
			// Release our reference of the DropTarget and it will delete itself eventually.
			m_dropTarget->Release();
		}

		::DestroyWindow(m_hWnd);
		m_hWnd = 0;
	}
}