Skip to content

Commit 20c9616

Browse files
author
nitrocaster
committed
Add virtual destructors to object interfaces.
1 parent 5a9cf98 commit 20c9616

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/Common/object_interfaces.h

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,65 @@
77
////////////////////////////////////////////////////////////////////////////
88

99
#pragma once
10+
#include "xrCore/xrCore.h"
1011

1112
class NET_Packet;
13+
class IReader;
14+
class IWriter;
1215

1316
class IPureDestroyableObject {
1417
public:
15-
virtual void destroy() = 0;
18+
virtual ~IPureDestroyableObject() = 0;
19+
20+
virtual void destroy() = 0;
1621
};
1722

23+
IC IPureDestroyableObject::~IPureDestroyableObject() {}
24+
1825
template <typename _storage_type>
1926
class IPureLoadableObject {
2027
public:
28+
virtual ~IPureLoadableObject() = 0;
2129
virtual void load(_storage_type &storage) = 0;
2230
};
2331

32+
template <typename _storage_type>
33+
IC IPureLoadableObject<_storage_type>::~IPureLoadableObject() {}
34+
2435
template <typename _storage_type>
2536
class IPureSavableObject {
2637
public:
38+
virtual ~IPureSavableObject() = 0;
2739
virtual void save(_storage_type &storage) = 0;
2840
};
2941

42+
template <typename _storage_type>
43+
IC IPureSavableObject<_storage_type>::~IPureSavableObject() {}
44+
3045
template <typename _storage_type_load, typename _storage_type_save>
3146
class IPureSerializeObject : public IPureLoadableObject<_storage_type_load>, public IPureSavableObject<_storage_type_save> {
3247
public:
48+
virtual ~IPureSerializeObject() = 0;
3349
};
3450

51+
template <typename _storage_type_load, typename _storage_type_save>
52+
IC IPureSerializeObject<typename _storage_type_load, typename _storage_type_save>::~IPureSerializeObject() {}
53+
3554
class IPureServerObject : public IPureSerializeObject<IReader,IWriter> {
3655
public:
56+
virtual ~IPureServerObject() = 0;
3757
virtual void STATE_Write (NET_Packet &tNetPacket) = 0;
3858
virtual void STATE_Read (NET_Packet &tNetPacket, u16 size) = 0;
3959
virtual void UPDATE_Write(NET_Packet &tNetPacket) = 0;
4060
virtual void UPDATE_Read (NET_Packet &tNetPacket) = 0;
4161
};
4262

63+
IC IPureServerObject::~IPureServerObject() {}
64+
4365
class IPureSchedulableObject {
4466
public:
67+
virtual ~IPureSchedulableObject() = 0;
4568
virtual void update () = 0;
4669
};
70+
71+
IC IPureSchedulableObject::~IPureSchedulableObject() {}

0 commit comments

Comments
 (0)