Browse Source

Fixed leaks detected by ASAN on Linux

Jorrit Rouwe 7 months ago
parent
commit
449d7915cf

+ 1 - 1
TestFramework/Image/Surface.cpp

@@ -203,7 +203,7 @@ SoftwareSurface::SoftwareSurface(int inWidth, int inHeight, ESurfaceFormat inFor
 
 SoftwareSurface::~SoftwareSurface()
 {
-	delete mPixelData;
+	delete [] mPixelData;
 }
 
 void SoftwareSurface::HardwareLock() const

+ 9 - 0
TestFramework/Window/ApplicationWindowLinux.cpp

@@ -7,6 +7,15 @@
 #include <Window/ApplicationWindowLinux.h>
 #include <Utils/Log.h>
 
+ApplicationWindowLinux::~ApplicationWindowLinux()
+{
+	if (mDisplay)
+	{
+		XDestroyWindow(mDisplay, mWindow);
+		XCloseDisplay(mDisplay);
+	}
+}
+
 void ApplicationWindowLinux::Initialize(const char *inTitle)
 {
 	// Open connection to X server

+ 3 - 0
TestFramework/Window/ApplicationWindowLinux.h

@@ -10,6 +10,9 @@
 class ApplicationWindowLinux : public ApplicationWindow
 {
 public:
+	/// Destructor
+									~ApplicationWindowLinux();
+
 	/// Initialize the window
 	virtual void					Initialize(const char *inTitle) override;