Free graphics contexts when closing Yutani windows in Python
This commit is contained in:
parent
6e96830525
commit
8989ff149c
@ -867,3 +867,9 @@ void reinit_graphics_yutani(gfx_context_t * out, yutani_window_t * window) {
|
||||
}
|
||||
}
|
||||
|
||||
void release_graphics_yutani(gfx_context_t * gfx) {
|
||||
if (gfx->backbuffer != gfx->buffer) {
|
||||
free(gfx->backbuffer);
|
||||
}
|
||||
free(gfx);
|
||||
}
|
||||
|
@ -468,5 +468,6 @@ extern void yutani_timer_request(yutani_t * yctx, uint32_t precision, uint32_t f
|
||||
extern gfx_context_t * init_graphics_yutani(yutani_window_t * window);
|
||||
extern gfx_context_t * init_graphics_yutani_double_buffer(yutani_window_t * window);
|
||||
extern void reinit_graphics_yutani(gfx_context_t * out, yutani_window_t * window);
|
||||
extern void release_graphics_yutani(gfx_context_t * gfx);
|
||||
|
||||
#endif /* _YUTANI_H */
|
||||
|
@ -364,6 +364,7 @@ class Window(object):
|
||||
def close(self):
|
||||
"""Close the window."""
|
||||
yutani_lib.yutani_close(yutani_ctx._ptr, self._ptr)
|
||||
yutani_lib.release_graphics_yutani(self._gfx)
|
||||
|
||||
def move(self, x, y):
|
||||
"""Move the window to the requested location."""
|
||||
|
Loading…
Reference in New Issue
Block a user