shithub: cstory

Download patch

ref: 1f88f7ffafd7c9fbc9ee54e4d8363c1c2dcc9b28
parent: 84c1e00c9509f61d06976b19bbf529eb31301b25
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Sep 10 17:26:22 EDT 2020

Make some code uniform

--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -236,12 +236,13 @@
 		return FALSE;
 	}
 
+	FreeBitmap(image_buffer);
+
 	surface_metadata[surf_no].type = SURFACE_SOURCE_RESOURCE;
 	surface_metadata[surf_no].width = width;
 	surface_metadata[surf_no].height = height;
 	surface_metadata[surf_no].bSystem = FALSE;
 	strcpy(surface_metadata[surf_no].name, name);
-	FreeBitmap(image_buffer);
 
 	return TRUE;
 }
@@ -297,12 +298,13 @@
 		return FALSE;
 	}
 
+	FreeBitmap(image_buffer);
+
 	surface_metadata[surf_no].type = SURFACE_SOURCE_FILE;
 	surface_metadata[surf_no].width = width;
 	surface_metadata[surf_no].height = height;
 	surface_metadata[surf_no].bSystem = FALSE;
 	strcpy(surface_metadata[surf_no].name, name);
-	FreeBitmap(image_buffer);
 
 	return TRUE;
 }
@@ -373,6 +375,7 @@
 	}
 
 	FreeBitmap(image_buffer);
+
 	surface_metadata[surf_no].type = SURFACE_SOURCE_FILE;
 	strcpy(surface_metadata[surf_no].name, name);