Browse Source

Added in logic to shut down the socket if the player is shutting down so it doesn’t hang

Shaddock Heath 8 years ago
parent
commit
bf588c59b7

+ 5 - 0
Source/AtomicApp/Player/IPCPlayerApp.cpp

@@ -212,6 +212,11 @@ namespace Atomic
 
 
     void IPCPlayerApp::Stop()
     void IPCPlayerApp::Stop()
     {
     {
+        if (debugPlayer_)
+        {
+            context_->GetSubsystem<JSDebugger>()->Shutdown();
+        }
+
         PlayerApp::Stop();
         PlayerApp::Stop();
     }
     }
 
 

+ 4 - 0
Source/AtomicJS/Javascript/JSDebugger.cpp

@@ -27,6 +27,10 @@ JSDebugger::~JSDebugger()
     instance_ = NULL;
     instance_ = NULL;
 }
 }
 
 
+void JSDebugger::Shutdown() const
+{
+    instance_ = NULL;
+}
 
 
 void JSDebugger::Reconnect() const
 void JSDebugger::Reconnect() const
 {
 {

+ 3 - 0
Source/AtomicJS/Javascript/JSDebugger.h

@@ -45,6 +45,9 @@ public:
     /// Reconnect to debugger socket (blocks main thread currently)
     /// Reconnect to debugger socket (blocks main thread currently)
     void Reconnect() const;
     void Reconnect() const;
 
 
+    /// Shut down the debugger
+    void Shutdown() const;
+
     /// Get the JSDebugger subsystem from external code
     /// Get the JSDebugger subsystem from external code
     static JSDebugger* GetInstance() { return instance_; }
     static JSDebugger* GetInstance() { return instance_; }