Give IInspector a virtual destructor for correct InspectorImpl destruction

Reviewed By: bnham

Differential Revision: D6815637

fbshipit-source-id: bfd3bd4a664ec51d5364df512bfc9bc366f516c1
This commit is contained in:
Andy Toulouse 2018-01-25 20:09:09 -08:00 committed by Facebook Github Bot
parent 7b1915e74d
commit 2a3c37f424
2 changed files with 7 additions and 4 deletions

View File

@ -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 {

View File

@ -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;