void WIN32Window::terminate() { SetCursor(NULL); if(m_defaultCursor) { DestroyCursor(m_defaultCursor); m_defaultCursor = NULL; } for(HCURSOR& cursor : m_cursors) DestroyCursor(cursor); m_cursors.clear(); internalDestroyGLContext(); if(m_deviceContext) { if(!ReleaseDC(m_window, m_deviceContext)) g_logger.error("Release device context failed."); m_deviceContext = NULL; } if(m_window) { if(!DestroyWindow(m_window)) g_logger.error("ERROR: Destroy window failed."); m_window = NULL; } if(m_instance) { if(!UnregisterClassA(g_app.getCompactName().c_str(), m_instance)) g_logger.error("UnregisterClassA failed"); m_instance = NULL; } }
void X11Window::terminate() { if(m_cursor != None) { XUndefineCursor(m_display, m_window); m_cursor = None; } if(m_hiddenCursor) { XFreeCursor(m_display, m_hiddenCursor); m_hiddenCursor = 0; } for(Cursor cursor : m_cursors) XFreeCursor(m_display, cursor); m_cursors.clear(); if(m_window) { XDestroyWindow(m_display, m_window); m_window = 0; } if(m_colormap) { XFreeColormap(m_display, m_colormap); m_colormap = 0; } internalDestroyGLContext(); if(m_visual) { XFree(m_visual); m_visual = 0; } if(m_xic) { XDestroyIC(m_xic); m_xic = 0; } if(m_xim) { XCloseIM(m_xim); m_xim = 0; } if(m_display) { XCloseDisplay(m_display); m_display = 0; } m_visible = false; }
void X11Window::terminate() { if(m_window) { XDestroyWindow(m_display, m_window); m_window = 0; } if(m_colormap) { XFreeColormap(m_display, m_colormap); m_colormap = 0; } internalDestroyGLContext(); if(m_visual) { XFree(m_visual); m_visual = 0; } if(m_xic) { XDestroyIC(m_xic); m_xic = 0; } if(m_xim) { XCloseIM(m_xim); m_xim = 0; } if(m_display) { XCloseDisplay(m_display); m_display = 0; } m_visible = false; }