1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

UWP: Fix app crash when managed_object->update_clipboard() is called

This commit is contained in:
Antokolos
2021-08-02 02:48:10 +06:00
committed by Rémi Verschelde
parent 7722461dc5
commit f5693969f0
4 changed files with 14 additions and 2 deletions

View File

@@ -284,8 +284,6 @@ Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
power_manager = memnew(PowerUWP);
managed_object->update_clipboard();
Clipboard::ContentChanged += ref new EventHandler<Platform::Object ^>(managed_object, &ManagedType::on_clipboard_changed);
accelerometer = Accelerometer::GetDefault();
@@ -387,6 +385,11 @@ void OS_UWP::alert(const String &p_alert, const String &p_title) {
msg->ShowAsync();
}
void OS_UWP::update_clipboard() {
// See https://stackoverflow.com/questions/58660743/uwp-app-crashes-when-clipboard-getcontent-is-called-from-inside-onnavigatedto
managed_object->update_clipboard();
}
void OS_UWP::ManagedType::alert_close(IUICommand ^ command) {
alert_close_handle = false;
}