Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit e4fa62f

Browse files
committed
[[ Cleanup ]] Provide virtual destructors for all classes that may be deleted.
1 parent 178d8f1 commit e4fa62f

File tree

6 files changed

+13
-1
lines changed

6 files changed

+13
-1
lines changed

engine/src/customprinter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,8 @@ class MCLoggingPrintingDevice: public MCCustomPrintingDevice
16801680
m_target = p_target;
16811681
}
16821682

1683+
virtual ~MCLoggingPrintingDevice(void) {}
1684+
16831685
////////
16841686

16851687
void Destroy(void)
@@ -1824,6 +1826,8 @@ class MCDebugPrintingDevice: public MCCustomPrintingDevice
18241826
m_stream = nil;
18251827
}
18261828

1829+
virtual ~MCDebugPrintingDevice(void) {}
1830+
18271831
void Destroy(void)
18281832
{
18291833
delete this;

engine/src/edittool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class MCGraphic;
3333
class MCEditTool
3434
{
3535
public:
36+
virtual ~MCEditTool(void) {};
3637
virtual bool mdown(int2 x, int2 y, uint2 which) = 0;
3738
virtual bool mfocus(int2 x, int2 y) = 0;
3839
virtual bool mup(int2 x, int2 y, uint2 which) = 0;

engine/src/lnxflst.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
2929
class MCFontlist
3030
{
3131
public:
32+
virtual ~MCFontlist(void) {};
3233
virtual void destroy(void) = 0;
3334

3435
virtual MCFontStruct *getfont(MCNameRef fname, uint2 &size, uint2 style, Boolean printer) = 0;

engine/src/mctheme.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ MCWidgetTabPaneInfo;
236236
class MCTheme //base class for all widgets
237237
{
238238
public:
239+
virtual ~MCTheme(void) {};
239240
virtual Boolean load();
240241
virtual void unload();
241242

engine/src/printer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ enum MCPrinterLinkType
5555
class MCPrinterDevice
5656
{
5757
public:
58+
virtual ~MCPrinterDevice(void) {};
59+
5860
// Return a descriptive string of the last printer error that occured. This
5961
// call should return NULL if ERROR has not been returned by any method of
6062
// the object.

engine/src/transfer.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ class MCPasteboard
201201
//
202202
// virtual bool QuerySystem(const char**& r_system_types, unsigned int& r_system_type_count) = 0;
203203
// virtual bool FetchSystem(const char *p_system_type, MCSharedString*& r_data) = 0;
204+
205+
protected:
206+
virtual ~MCPasteboard(void) {};
204207
};
205208

206209

@@ -248,7 +251,7 @@ class MCLocalPasteboard: public MCPasteboard
248251

249252
private:
250253
// Destroy the object.
251-
~MCLocalPasteboard(void);
254+
virtual ~MCLocalPasteboard(void);
252255

253256
// Search for the given type on the pasteboard and return the index.
254257
// If the type is not found, false is returned.

0 commit comments

Comments
 (0)