You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Disable threads used to check on plugins to load
The functionality is unavailable on Android (requires export capability) and unnecessarily consumes resources
This commit is contained in:
@@ -248,6 +248,7 @@ static const char *AAB_ASSETS_DIRECTORY = "res://android/build/assetPacks/instal
|
|||||||
static const int DEFAULT_MIN_SDK_VERSION = 19; // Should match the value in 'platform/android/java/app/config.gradle#minSdk'
|
static const int DEFAULT_MIN_SDK_VERSION = 19; // Should match the value in 'platform/android/java/app/config.gradle#minSdk'
|
||||||
static const int DEFAULT_TARGET_SDK_VERSION = 32; // Should match the value in 'platform/android/java/app/config.gradle#targetSdk'
|
static const int DEFAULT_TARGET_SDK_VERSION = 32; // Should match the value in 'platform/android/java/app/config.gradle#targetSdk'
|
||||||
|
|
||||||
|
#ifndef ANDROID_ENABLED
|
||||||
void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
|
void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
|
||||||
EditorExportPlatformAndroid *ea = static_cast<EditorExportPlatformAndroid *>(ud);
|
EditorExportPlatformAndroid *ea = static_cast<EditorExportPlatformAndroid *>(ud);
|
||||||
|
|
||||||
@@ -277,7 +278,6 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ANDROID_ENABLED
|
|
||||||
// Check for devices updates
|
// Check for devices updates
|
||||||
String adb = get_adb_path();
|
String adb = get_adb_path();
|
||||||
if (FileAccess::exists(adb)) {
|
if (FileAccess::exists(adb)) {
|
||||||
@@ -389,7 +389,6 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
|
|||||||
ea->devices_changed.set();
|
ea->devices_changed.set();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
uint64_t sleep = 200;
|
uint64_t sleep = 200;
|
||||||
uint64_t wait = 3000000;
|
uint64_t wait = 3000000;
|
||||||
@@ -402,7 +401,6 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ANDROID_ENABLED
|
|
||||||
if (EditorSettings::get_singleton()->get("export/android/shutdown_adb_on_exit")) {
|
if (EditorSettings::get_singleton()->get("export/android/shutdown_adb_on_exit")) {
|
||||||
String adb = get_adb_path();
|
String adb = get_adb_path();
|
||||||
if (!FileAccess::exists(adb)) {
|
if (!FileAccess::exists(adb)) {
|
||||||
@@ -413,8 +411,8 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
|
|||||||
args.push_back("kill-server");
|
args.push_back("kill-server");
|
||||||
OS::get_singleton()->execute(adb, args);
|
OS::get_singleton()->execute(adb, args);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
String EditorExportPlatformAndroid::get_project_name(const String &p_name) const {
|
String EditorExportPlatformAndroid::get_project_name(const String &p_name) const {
|
||||||
String aname;
|
String aname;
|
||||||
@@ -3138,10 +3136,14 @@ EditorExportPlatformAndroid::EditorExportPlatformAndroid() {
|
|||||||
|
|
||||||
devices_changed.set();
|
devices_changed.set();
|
||||||
plugins_changed.set();
|
plugins_changed.set();
|
||||||
|
#ifndef ANDROID_ENABLED
|
||||||
check_for_changes_thread.start(_check_for_changes_poll_thread, this);
|
check_for_changes_thread.start(_check_for_changes_poll_thread, this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorExportPlatformAndroid::~EditorExportPlatformAndroid() {
|
EditorExportPlatformAndroid::~EditorExportPlatformAndroid() {
|
||||||
|
#ifndef ANDROID_ENABLED
|
||||||
quit_request.set();
|
quit_request.set();
|
||||||
check_for_changes_thread.wait_to_finish();
|
check_for_changes_thread.wait_to_finish();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,10 +80,12 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
|
|||||||
Vector<Device> devices;
|
Vector<Device> devices;
|
||||||
SafeFlag devices_changed;
|
SafeFlag devices_changed;
|
||||||
Mutex device_lock;
|
Mutex device_lock;
|
||||||
|
#ifndef ANDROID_ENABLED
|
||||||
Thread check_for_changes_thread;
|
Thread check_for_changes_thread;
|
||||||
SafeFlag quit_request;
|
SafeFlag quit_request;
|
||||||
|
|
||||||
static void _check_for_changes_poll_thread(void *ud);
|
static void _check_for_changes_poll_thread(void *ud);
|
||||||
|
#endif
|
||||||
|
|
||||||
String get_project_name(const String &p_name) const;
|
String get_project_name(const String &p_name) const;
|
||||||
|
|
||||||
|
|||||||
@@ -1884,10 +1884,14 @@ bool EditorExportPlatformIOS::has_valid_project_configuration(const Ref<EditorEx
|
|||||||
EditorExportPlatformIOS::EditorExportPlatformIOS() {
|
EditorExportPlatformIOS::EditorExportPlatformIOS() {
|
||||||
logo = ImageTexture::create_from_image(memnew(Image(_ios_logo)));
|
logo = ImageTexture::create_from_image(memnew(Image(_ios_logo)));
|
||||||
plugins_changed.set();
|
plugins_changed.set();
|
||||||
|
#ifndef ANDROID_ENABLED
|
||||||
check_for_changes_thread.start(_check_for_changes_poll_thread, this);
|
check_for_changes_thread.start(_check_for_changes_poll_thread, this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorExportPlatformIOS::~EditorExportPlatformIOS() {
|
EditorExportPlatformIOS::~EditorExportPlatformIOS() {
|
||||||
|
#ifndef ANDROID_ENABLED
|
||||||
quit_request.set();
|
quit_request.set();
|
||||||
check_for_changes_thread.wait_to_finish();
|
check_for_changes_thread.wait_to_finish();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,10 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
|
|||||||
|
|
||||||
// Plugins
|
// Plugins
|
||||||
SafeFlag plugins_changed;
|
SafeFlag plugins_changed;
|
||||||
|
#ifndef ANDROID_ENABLED
|
||||||
Thread check_for_changes_thread;
|
Thread check_for_changes_thread;
|
||||||
SafeFlag quit_request;
|
SafeFlag quit_request;
|
||||||
|
#endif
|
||||||
Mutex plugins_lock;
|
Mutex plugins_lock;
|
||||||
Vector<PluginConfigIOS> plugins;
|
Vector<PluginConfigIOS> plugins;
|
||||||
|
|
||||||
@@ -139,6 +141,7 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef ANDROID_ENABLED
|
||||||
static void _check_for_changes_poll_thread(void *ud) {
|
static void _check_for_changes_poll_thread(void *ud) {
|
||||||
EditorExportPlatformIOS *ea = static_cast<EditorExportPlatformIOS *>(ud);
|
EditorExportPlatformIOS *ea = static_cast<EditorExportPlatformIOS *>(ud);
|
||||||
|
|
||||||
@@ -172,6 +175,7 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const override;
|
virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const override;
|
||||||
|
|||||||
Reference in New Issue
Block a user