commit 3775c92208826f42aef18d0ec6b4408d4de3ff6d
parent 21dfb8dd91bf2ea0678b375d10b665d0fff892a9
Author: falkTX <falktx@gmail.com>
Date: Wed, 23 Mar 2016 09:03:30 +0100
Fix graphical issues when closing UIs in Ableton Live
Diffstat:
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/dgl/src/Image.cpp b/dgl/src/Image.cpp
@@ -68,7 +68,9 @@ Image::~Image()
{
if (fTextureId != 0)
{
+#ifndef DISTRHO_OS_MAC // FIXME
glDeleteTextures(1, &fTextureId);
+#endif
fTextureId = 0;
}
}
diff --git a/dgl/src/pugl/pugl_osx.m b/dgl/src/pugl/pugl_osx.m
@@ -199,8 +199,6 @@ puglDisplay(PuglView* view)
- (void) reshape
{
- [[self openGLContext] update];
-
if (!puglview) {
/* NOTE: Apparently reshape gets called when the GC gets around to
deleting the view (?), so we must have reset puglview to NULL when
@@ -209,6 +207,8 @@ puglDisplay(PuglView* view)
return;
}
+ [[self openGLContext] update];
+
NSRect bounds = [self bounds];
int width = bounds.size.width;
int height = bounds.size.height;
@@ -438,11 +438,13 @@ void
puglLeaveContext(PuglView* view, bool flush)
{
#ifdef PUGL_HAVE_GL
- if (view->ctx_type == PUGL_GL && flush) {
- if (view->impl->glview->doubleBuffered) {
- [[view->impl->glview openGLContext] flushBuffer];
- } else {
- glFlush();
+ if (view->ctx_type == PUGL_GL) {
+ if (flush) {
+ if (view->impl->glview->doubleBuffered) {
+ [[view->impl->glview openGLContext] flushBuffer];
+ } else {
+ glFlush();
+ }
}
//[NSOpenGLContext clearCurrentContext];
}