restarting doesnt crash anymore and disabling plugin works safer, general bug fixes

This commit is contained in:
2023-12-15 15:51:39 +01:00
parent e69c514b44
commit 8de5c65cdc
17 changed files with 134 additions and 73 deletions

View File

@@ -93,7 +93,7 @@ discord_sdk::discord_sdk()
discord_sdk::~discord_sdk()
{
singleton = nullptr;
delete core;
delete core; // couldn't use destructor because it would not compile on linux
core = nullptr;
}

View File

@@ -3,7 +3,7 @@
#include <stdio.h>
#include "lib/discord_game_sdk/cpp/discord.h"
#include <godot_cpp/classes/ref_counted.hpp>
#include <godot_cpp/classes/object.hpp>
#include <godot_cpp/core/class_db.hpp>
#define H_SET_GET(variable_type, property_name) \
@@ -13,7 +13,7 @@
using namespace godot;
class discord_sdk : public RefCounted
class discord_sdk : public Object
{
GDCLASS(discord_sdk, Object);

View File

@@ -26,7 +26,6 @@ void uninitialize_discordsdk_module(ModuleInitializationLevel p_level)
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE)
{
Engine::get_singleton()->unregister_singleton("discord_sdk");
memdelete(discordsdk);
}
}