aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/surface.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/surface.h b/graphics/surface.h
index 07e289b0bb..f1b2aa64ab 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -334,7 +334,9 @@ public:
*/
struct SharedPtrSurfaceDeleter {
void operator()(Surface *ptr) {
- ptr->free();
+ if (ptr) {
+ ptr->free();
+ }
delete ptr;
}
};