Merge pull request #38772 from neikeq/issue-38729
websocket: Fix crash at exit when not running the editor
This commit is contained in:
commit
5b2c0c342a
1 changed files with 8 additions and 1 deletions
|
@ -42,9 +42,16 @@
|
||||||
#endif
|
#endif
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
#include "editor/debugger/editor_debugger_server.h"
|
#include "editor/debugger/editor_debugger_server.h"
|
||||||
|
#include "editor/editor_node.h"
|
||||||
#include "editor_debugger_server_websocket.h"
|
#include "editor_debugger_server_websocket.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
|
static void _editor_init_callback() {
|
||||||
|
EditorDebuggerServer::register_protocol_handler("ws://", EditorDebuggerServerWebSocket::create);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void register_websocket_types() {
|
void register_websocket_types() {
|
||||||
#ifdef JAVASCRIPT_ENABLED
|
#ifdef JAVASCRIPT_ENABLED
|
||||||
EMWSPeer::make_default();
|
EMWSPeer::make_default();
|
||||||
|
@ -62,7 +69,7 @@ void register_websocket_types() {
|
||||||
ClassDB::register_custom_instance_class<WebSocketPeer>();
|
ClassDB::register_custom_instance_class<WebSocketPeer>();
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
EditorDebuggerServer::register_protocol_handler("ws://", EditorDebuggerServerWebSocket::create);
|
EditorNode::add_init_callback(&_editor_init_callback);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue