Skip to content

Commit 2a3c37f

Browse files
toulousefacebook-github-bot
authored andcommitted
Give IInspector a virtual destructor for correct InspectorImpl destruction
Reviewed By: bnham Differential Revision: D6815637 fbshipit-source-id: bfd3bd4a664ec51d5364df512bfc9bc366f516c1
1 parent 7b1915e commit 2a3c37f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

ReactCommon/jsinspector/InspectorInterfaces.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ namespace react {
1818
// pure destructors in C++ are odd. You would think they don't want an
1919
// implementation, but in fact the linker requires one. Define them to be
2020
// empty so that people don't count on them for any particular behaviour.
21-
IDestructible::~IDestructible() { }
22-
ILocalConnection::~ILocalConnection() { }
23-
IRemoteConnection::~IRemoteConnection() { }
21+
IDestructible::~IDestructible() {}
22+
ILocalConnection::~ILocalConnection() {}
23+
IRemoteConnection::~IRemoteConnection() {}
24+
IInspector::~IInspector() {}
2425

2526
namespace {
2627

ReactCommon/jsinspector/InspectorInterfaces.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ class ILocalConnection : public IDestructible {
4444
};
4545

4646
/// IInspector tracks debuggable JavaScript targets (pages).
47-
class IInspector {
47+
class IInspector : public IDestructible {
4848
public:
4949
using ConnectFunc = std::function<std::unique_ptr<ILocalConnection>(
5050
std::unique_ptr<IRemoteConnection>)>;
5151

52+
virtual ~IInspector() = 0;
53+
5254
/// addPage is called by the VM to add a page to the list of debuggable pages.
5355
virtual int addPage(const std::string& title, ConnectFunc connectFunc) = 0;
5456

0 commit comments

Comments
 (0)