Skip to content

Commit

Permalink
Give IInspector a virtual destructor for correct InspectorImpl destru…
Browse files Browse the repository at this point in the history
…ction

Reviewed By: bnham

Differential Revision: D6815637

fbshipit-source-id: bfd3bd4a664ec51d5364df512bfc9bc366f516c1
  • Loading branch information
toulouse authored and facebook-github-bot committed Jan 26, 2018
1 parent 7b1915e commit 2a3c37f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions ReactCommon/jsinspector/InspectorInterfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ namespace react {
// pure destructors in C++ are odd. You would think they don't want an
// implementation, but in fact the linker requires one. Define them to be
// empty so that people don't count on them for any particular behaviour.
IDestructible::~IDestructible() { }
ILocalConnection::~ILocalConnection() { }
IRemoteConnection::~IRemoteConnection() { }
IDestructible::~IDestructible() {}
ILocalConnection::~ILocalConnection() {}
IRemoteConnection::~IRemoteConnection() {}
IInspector::~IInspector() {}

namespace {

Expand Down
4 changes: 3 additions & 1 deletion ReactCommon/jsinspector/InspectorInterfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ class ILocalConnection : public IDestructible {
};

/// IInspector tracks debuggable JavaScript targets (pages).
class IInspector {
class IInspector : public IDestructible {
public:
using ConnectFunc = std::function<std::unique_ptr<ILocalConnection>(
std::unique_ptr<IRemoteConnection>)>;

virtual ~IInspector() = 0;

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

Expand Down

0 comments on commit 2a3c37f

Please sign in to comment.