From 9ae3aa65b7bb7642417f5b46aa09edd603d9e859 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 3 Sep 2023 11:46:46 +0200 Subject: [PATCH] Added finish method to the NavigationServers. --- main/main.cpp | 7 +++++-- servers/navigation_2d_server.cpp | 3 +++ servers/navigation_2d_server.h | 1 + servers/navigation_server.cpp | 3 +++ servers/navigation_server.h | 1 + 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 75bc1d17e..ef0cad0f3 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -279,11 +279,14 @@ void initialize_navigation_server() { } void finalize_navigation_server() { - memdelete(navigation_server); - navigation_server = nullptr; + navigation_2d_server->finish(); + navigation_server->finish(); memdelete(navigation_2d_server); navigation_2d_server = nullptr; + + memdelete(navigation_server); + navigation_server = nullptr; } //#define DEBUG_INIT diff --git a/servers/navigation_2d_server.cpp b/servers/navigation_2d_server.cpp index 8fd048054..70bf0f20a 100644 --- a/servers/navigation_2d_server.cpp +++ b/servers/navigation_2d_server.cpp @@ -147,6 +147,9 @@ void Navigation2DServer::init() { #endif // DEBUG_ENABLED } +void Navigation2DServer::finish() { +} + void Navigation2DServer::query_path(const Ref &p_query_parameters, Ref p_query_result) const { ERR_FAIL_COND(!p_query_parameters.is_valid()); ERR_FAIL_COND(!p_query_result.is_valid()); diff --git a/servers/navigation_2d_server.h b/servers/navigation_2d_server.h index c431f1a30..8c9f92c75 100644 --- a/servers/navigation_2d_server.h +++ b/servers/navigation_2d_server.h @@ -259,6 +259,7 @@ public: virtual NavigationUtilities::PathQueryResult2D _query_path(const NavigationUtilities::PathQueryParameters2D &p_parameters) const = 0; virtual void init(); + virtual void finish(); Navigation2DServer(); virtual ~Navigation2DServer(); diff --git a/servers/navigation_server.cpp b/servers/navigation_server.cpp index e25cd290d..75ceb618e 100644 --- a/servers/navigation_server.cpp +++ b/servers/navigation_server.cpp @@ -47,6 +47,9 @@ NavigationServer *NavigationServer::singleton = nullptr; void NavigationServer::init() { } +void NavigationServer::finish() { +} + void NavigationServer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_maps"), &NavigationServer::get_maps); diff --git a/servers/navigation_server.h b/servers/navigation_server.h index 66e90394f..d447bc134 100644 --- a/servers/navigation_server.h +++ b/servers/navigation_server.h @@ -288,6 +288,7 @@ public: virtual NavigationUtilities::PathQueryResult _query_path(const NavigationUtilities::PathQueryParameters &p_parameters) const = 0; virtual void init(); + virtual void finish(); enum ProcessInfo { INFO_ACTIVE_MAPS,