static int
dri3_set_swap_interval(__GLXDRIdrawable *pdraw, int interval)
{
+ assert(pdraw != NULL);
+
struct dri3_drawable *priv = (struct dri3_drawable *) pdraw;
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
struct dri3_screen *psc = (struct dri3_screen *) priv->base.psc;
static int
dri3_get_swap_interval(__GLXDRIdrawable *pdraw)
{
+ assert(pdraw != NULL);
+
struct dri3_drawable *priv = (struct dri3_drawable *) pdraw;
return priv->swap_interval;
psc->driScreen->setSwapInterval) {
__GLXDRIdrawable *pdraw =
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
- psc->driScreen->setSwapInterval(pdraw, interval);
+ /* Simply ignore the command if the GLX drawable has been destroyed but
+ * the context is still bound.
+ */
+ if (pdraw)
+ psc->driScreen->setSwapInterval(pdraw, interval);
return 0;
}
#endif
if (psc && psc->driScreen && psc->driScreen->setSwapInterval) {
__GLXDRIdrawable *pdraw =
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
- return psc->driScreen->setSwapInterval(pdraw, interval);
+
+ /* Simply ignore the command if the GLX drawable has been destroyed but
+ * the context is still bound.
+ */
+ if (!pdraw)
+ return 0;
+
+ return psc->driScreen->setSwapInterval(pdraw, interval);
}
}
#endif
if (psc && psc->driScreen && psc->driScreen->getSwapInterval) {
__GLXDRIdrawable *pdraw =
GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
- return psc->driScreen->getSwapInterval(pdraw);
+ if (pdraw)
+ return psc->driScreen->getSwapInterval(pdraw);
}
}
#endif