From a3ffe68f2d6004b8c19ff6909ab394b5a78b210d Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 30 Nov 2014 21:02:41 -0300 Subject: [PATCH] Minor check in ~ScopedHandle() --- src/she/scoped_handle.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/she/scoped_handle.h b/src/she/scoped_handle.h index 8c0740ef4..4e7e1b5e6 100644 --- a/src/she/scoped_handle.h +++ b/src/she/scoped_handle.h @@ -14,7 +14,10 @@ namespace she { class ScopedHandle { public: ScopedHandle(T* handle) : m_handle(handle) { } - ~ScopedHandle() { m_handle->dispose(); } + ~ScopedHandle() { + if (m_handle) + m_handle->dispose(); + } T* operator->() { return m_handle; } operator T*() { return m_handle; }