This is an automated email from the git hooks/post-receive script. thansen pushed a commit to branch master in repository aseprite.
commit 25a24a93d8eb868ff9eca095ac226da816b57bce Author: David Capello <[email protected]> Date: Wed Apr 13 09:00:29 2016 -0300 Avoid using an uninitialized m_surface pointer in SkiaDisplay This should fix problems launching Aseprite on OS X (e.g. #1059). --- src/she/skia/skia_display.cpp | 7 +++++-- src/she/skia/skia_display.h | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/she/skia/skia_display.cpp b/src/she/skia/skia_display.cpp index 5389499..49760a6 100644 --- a/src/she/skia/skia_display.cpp +++ b/src/she/skia/skia_display.cpp @@ -18,7 +18,8 @@ namespace she { SkiaDisplay::SkiaDisplay(int width, int height, int scale) - : m_window(instance()->eventQueue(), this, width, height, scale) + : m_initialized(false) + , m_window(instance()->eventQueue(), this, width, height, scale) , m_surface(new SkiaSurface) , m_customSurface(false) , m_nativeCursor(kArrowCursor) @@ -27,6 +28,8 @@ SkiaDisplay::SkiaDisplay(int width, int height, int scale) height / scale); m_window.setScale(scale); m_window.setVisible(true); + + m_initialized = true; } void SkiaDisplay::setSkiaSurface(SkiaSurface* surface) @@ -56,7 +59,7 @@ void SkiaDisplay::resize(const gfx::Size& size) ev.setDisplay(this); she::queue_event(ev); - if (m_customSurface) + if (!m_initialized || m_customSurface) return; m_surface->dispose(); diff --git a/src/she/skia/skia_display.h b/src/she/skia/skia_display.h index 5e78223..367bea7 100644 --- a/src/she/skia/skia_display.h +++ b/src/she/skia/skia_display.h @@ -60,6 +60,10 @@ public: DisplayHandle nativeHandle() override; private: + // Flag used to avoid accessing to an invalid m_surface in the first + // SkiaDisplay::resize() call when the SkiaWindow is created (as the + // window is created, it send a first resize event.) + bool m_initialized; SkiaWindow m_window; SkiaSurface* m_surface; bool m_customSurface; -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

