[Scummvm-git-logs] scummvm master -> 03ddc4dd4d048ba47959941b2b2a4a7c85b244b2

npjg nathanael.gentrydb8 at gmail.com
Tue Jul 7 20:43:29 UTC 2020


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
48599bd622 DIRECTOR: Properly destroy cast widgets
03ddc4dd4d GRAPHICS: MACGUI: Standardize destructors for widget subclasses


Commit: 48599bd622d9e6d7fb04caa97607c35e55d9e331
    https://github.com/scummvm/scummvm/commit/48599bd622d9e6d7fb04caa97607c35e55d9e331
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-07T16:41:53-04:00

Commit Message:
DIRECTOR: Properly destroy cast widgets

Changed paths:
    engines/director/castmember.cpp
    engines/director/castmember.h


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index ee9b660321..c5e4b6c8f3 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -42,6 +42,11 @@ CastMember::CastMember(Cast* cast, uint16 castId) {
 	_modified = true;
 }
 
+CastMember::~CastMember() {
+	if (_widget)
+		delete _widget;
+}
+
 BitmapCastMember::BitmapCastMember(Cast *cast, uint16 castId, Common::ReadStreamEndian &stream, uint32 castTag, uint16 version)
 		: CastMember(cast, castId) {
 	_type = kCastBitmap;
diff --git a/engines/director/castmember.h b/engines/director/castmember.h
index b68f347aa0..6e1a1a5a63 100644
--- a/engines/director/castmember.h
+++ b/engines/director/castmember.h
@@ -54,7 +54,7 @@ struct Resource;
 class CastMember {
 public:
 	CastMember(Cast *cast, uint16 castId);
-	virtual ~CastMember() {};
+	virtual ~CastMember();
 
 	Cast *getCast() { return _cast; }
 	uint16 getID() { return _castId; }


Commit: 03ddc4dd4d048ba47959941b2b2a4a7c85b244b2
    https://github.com/scummvm/scummvm/commit/03ddc4dd4d048ba47959941b2b2a4a7c85b244b2
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-07T16:41:53-04:00

Commit Message:
GRAPHICS: MACGUI: Standardize destructors for widget subclasses

Changed paths:
    graphics/macgui/mactext.cpp
    graphics/macgui/macwidget.cpp
    graphics/macgui/macwindow.cpp
    graphics/macgui/macwindow.h


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 635e49d7a2..083700237f 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -251,7 +251,6 @@ MacText::~MacText() {
 	delete _cursorRect;
 	delete _surface;
 	delete _cursorSurface;
-	delete _composeSurface;
 }
 
 void MacText::setMaxWidth(int maxWidth) {
diff --git a/graphics/macgui/macwidget.cpp b/graphics/macgui/macwidget.cpp
index 75bbeedb8d..3c930e00e8 100644
--- a/graphics/macgui/macwidget.cpp
+++ b/graphics/macgui/macwidget.cpp
@@ -59,6 +59,16 @@ MacWidget::MacWidget(MacWidget *parent, int x, int y, int w, int h, MacWindowMan
 MacWidget::~MacWidget() {
 	if (_parent)
 		_parent->removeWidget(this, false);
+
+	if (_composeSurface) {
+		_composeSurface->free();
+		delete _composeSurface;
+	}
+
+	if (_maskSurface) {
+		_maskSurface->free();
+		delete _maskSurface;
+	}
 }
 
 void MacWidget::setActive(bool active) {
diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index f413f734d9..1f82ef6d96 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -62,15 +62,6 @@ MacWindow::MacWindow(int id, bool scrollable, bool resizable, bool editable, Mac
 	_closeable = false;
 
 	_borderWidth = kBorderWidth;
-
-	_composeSurface = new Graphics::ManagedSurface();
-}
-
-MacWindow::~MacWindow() {
-	if (_composeSurface)
-		_composeSurface->free();
-
-	delete _composeSurface;
 }
 
 static const byte noborderData[3][3] = {
diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h
index 8b9ba67fbc..53d1e50ac5 100644
--- a/graphics/macgui/macwindow.h
+++ b/graphics/macgui/macwindow.h
@@ -160,7 +160,7 @@ public:
 	 * @param wm See BaseMacWindow.
 	 */
 	MacWindow(int id, bool scrollable, bool resizable, bool editable, MacWindowManager *wm);
-	virtual ~MacWindow();
+	virtual ~MacWindow() {}
 
 	/**
 	 * Change the window's location to fixed coordinates (not delta).




More information about the Scummvm-git-logs mailing list