fixed a random crash and stabilized the plugin in general
This commit is contained in:
@@ -87,15 +87,17 @@ SET_GET(is_public_party, activity.GetParty().SetPrivacy(static_cast<discord::Act
|
||||
|
||||
DiscordSDK::DiscordSDK()
|
||||
{
|
||||
ERR_FAIL_COND(singleton != nullptr);
|
||||
singleton = this;
|
||||
}
|
||||
|
||||
DiscordSDK::~DiscordSDK()
|
||||
{
|
||||
singleton = nullptr;
|
||||
app_id = 0;
|
||||
delete core; // couldn't use destructor because it would not compile on linux
|
||||
core = nullptr;
|
||||
ERR_FAIL_COND(singleton != this);
|
||||
singleton = nullptr;
|
||||
}
|
||||
|
||||
DiscordSDK *DiscordSDK::get_singleton()
|
||||
|
Submodule src/lib/godot-cpp updated: 78ffea5b13...51c752c46b
@@ -28,6 +28,7 @@ void uninitialize_discordsdk_module(ModuleInitializationLevel p_level)
|
||||
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE)
|
||||
{
|
||||
Engine::get_singleton()->unregister_singleton("DiscordSDK");
|
||||
memdelete(discordsdk);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user