fixed a random crash and stabilized the plugin in general
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# Objects.
|
# Objects.
|
||||||
.scons-cache/
|
.scons-cache/
|
||||||
*.os
|
*.os
|
||||||
|
*.o
|
||||||
|
|
||||||
# SConstruct
|
# SConstruct
|
||||||
.sconf_temp
|
.sconf_temp
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -87,15 +87,17 @@ SET_GET(is_public_party, activity.GetParty().SetPrivacy(static_cast<discord::Act
|
|||||||
|
|
||||||
DiscordSDK::DiscordSDK()
|
DiscordSDK::DiscordSDK()
|
||||||
{
|
{
|
||||||
|
ERR_FAIL_COND(singleton != nullptr);
|
||||||
singleton = this;
|
singleton = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
DiscordSDK::~DiscordSDK()
|
DiscordSDK::~DiscordSDK()
|
||||||
{
|
{
|
||||||
singleton = nullptr;
|
|
||||||
app_id = 0;
|
app_id = 0;
|
||||||
delete core; // couldn't use destructor because it would not compile on linux
|
delete core; // couldn't use destructor because it would not compile on linux
|
||||||
core = nullptr;
|
core = nullptr;
|
||||||
|
ERR_FAIL_COND(singleton != this);
|
||||||
|
singleton = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
DiscordSDK *DiscordSDK::get_singleton()
|
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)
|
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE)
|
||||||
{
|
{
|
||||||
Engine::get_singleton()->unregister_singleton("DiscordSDK");
|
Engine::get_singleton()->unregister_singleton("DiscordSDK");
|
||||||
|
memdelete(discordsdk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user