Fix wait for thread not started
This commit is contained in:
parent
240ed28291
commit
4aaa2e6477
@ -339,7 +339,9 @@ void AudioDriverALSA::finish_output_device() {
|
||||
|
||||
void AudioDriverALSA::finish() {
|
||||
exit_thread.set();
|
||||
if (thread.is_started()) {
|
||||
thread.wait_to_finish();
|
||||
}
|
||||
|
||||
finish_output_device();
|
||||
}
|
||||
|
@ -207,7 +207,9 @@ Error MIDIDriverALSAMidi::open() {
|
||||
|
||||
void MIDIDriverALSAMidi::close() {
|
||||
exit_thread.set();
|
||||
if (thread.is_started()) {
|
||||
thread.wait_to_finish();
|
||||
}
|
||||
|
||||
for (int i = 0; i < connected_inputs.size(); i++) {
|
||||
snd_rawmidi_t *midi_in = connected_inputs[i].rawmidi_ptr;
|
||||
|
@ -676,7 +676,9 @@ void AudioDriverPulseAudio::finish() {
|
||||
}
|
||||
|
||||
exit_thread.set();
|
||||
if (thread.is_started()) {
|
||||
thread.wait_to_finish();
|
||||
}
|
||||
|
||||
finish_output_device();
|
||||
|
||||
|
@ -930,7 +930,9 @@ void AudioDriverWASAPI::unlock() {
|
||||
|
||||
void AudioDriverWASAPI::finish() {
|
||||
exit_thread.set();
|
||||
if (thread.is_started()) {
|
||||
thread.wait_to_finish();
|
||||
}
|
||||
|
||||
finish_input_device();
|
||||
finish_output_device();
|
||||
|
@ -151,7 +151,9 @@ void AudioDriverXAudio2::unlock() {
|
||||
|
||||
void AudioDriverXAudio2::finish() {
|
||||
exit_thread.set();
|
||||
if (thread.is_started()) {
|
||||
thread.wait_to_finish();
|
||||
}
|
||||
|
||||
if (source_voice) {
|
||||
source_voice->Stop(0);
|
||||
|
@ -1256,7 +1256,9 @@ void EditorFileSystem::_notification(int p_what) {
|
||||
if (scanning_changes_done) {
|
||||
set_process(false);
|
||||
|
||||
if (thread_sources.is_started()) {
|
||||
thread_sources.wait_to_finish();
|
||||
}
|
||||
bool changed = _update_scan_actions();
|
||||
_update_pending_script_classes();
|
||||
if (changed) {
|
||||
|
@ -2371,9 +2371,6 @@ void EditorHelp::update_doc() {
|
||||
|
||||
void EditorHelp::cleanup_doc() {
|
||||
_wait_for_thread();
|
||||
if (doc_gen_use_threads) {
|
||||
thread.wait_to_finish();
|
||||
}
|
||||
memdelete(doc);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,9 @@ NoiseTexture2D::~NoiseTexture2D() {
|
||||
if (texture.is_valid()) {
|
||||
RS::get_singleton()->free(texture);
|
||||
}
|
||||
if (noise_thread.is_started()) {
|
||||
noise_thread.wait_to_finish();
|
||||
}
|
||||
}
|
||||
|
||||
void NoiseTexture2D::_bind_methods() {
|
||||
|
@ -604,7 +604,9 @@ RaycastOcclusionCull::~RaycastOcclusionCull() {
|
||||
for (KeyValue<RID, Scenario> &K : scenarios) {
|
||||
Scenario &scenario = K.value;
|
||||
if (scenario.commit_thread) {
|
||||
if (scenario.commit_thread->is_started()) {
|
||||
scenario.commit_thread->wait_to_finish();
|
||||
}
|
||||
memdelete(scenario.commit_thread);
|
||||
}
|
||||
|
||||
|
@ -1984,6 +1984,8 @@ EditorExportPlatformIOS::EditorExportPlatformIOS() {
|
||||
EditorExportPlatformIOS::~EditorExportPlatformIOS() {
|
||||
#ifndef ANDROID_ENABLED
|
||||
quit_request.set();
|
||||
if (check_for_changes_thread.is_started()) {
|
||||
check_for_changes_thread.wait_to_finish();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -687,5 +687,7 @@ EditorExportPlatformWeb::~EditorExportPlatformWeb() {
|
||||
server->stop();
|
||||
}
|
||||
server_quit = true;
|
||||
if (server_thread.is_started()) {
|
||||
server_thread.wait_to_finish();
|
||||
}
|
||||
}
|
||||
|
@ -270,7 +270,9 @@ void NavigationRegion3D::bake_navigation_mesh(bool p_on_thread) {
|
||||
|
||||
void NavigationRegion3D::_bake_finished(Ref<NavigationMesh> p_nav_mesh) {
|
||||
set_navigation_mesh(p_nav_mesh);
|
||||
if (bake_thread.is_started()) {
|
||||
bake_thread.wait_to_finish();
|
||||
}
|
||||
emit_signal(SNAME("bake_finished"));
|
||||
}
|
||||
|
||||
|
@ -190,8 +190,10 @@ void HTTPRequest::cancel_request() {
|
||||
set_process_internal(false);
|
||||
} else {
|
||||
thread_request_quit.set();
|
||||
if (thread.is_started()) {
|
||||
thread.wait_to_finish();
|
||||
}
|
||||
}
|
||||
|
||||
file.unref();
|
||||
decompressor.unref();
|
||||
|
@ -136,8 +136,10 @@ void AudioDriverDummy::mix_audio(int p_frames, int32_t *p_buffer) {
|
||||
void AudioDriverDummy::finish() {
|
||||
if (use_threads) {
|
||||
exit_thread.set();
|
||||
if (thread.is_started()) {
|
||||
thread.wait_to_finish();
|
||||
}
|
||||
}
|
||||
|
||||
if (samples_in) {
|
||||
memdelete_arr(samples_in);
|
||||
|
@ -120,7 +120,9 @@ void AudioEffectRecordInstance::init() {
|
||||
}
|
||||
|
||||
void AudioEffectRecordInstance::finish() {
|
||||
if (io_thread.is_started()) {
|
||||
io_thread.wait_to_finish();
|
||||
}
|
||||
}
|
||||
|
||||
AudioEffectRecordInstance::~AudioEffectRecordInstance() {
|
||||
|
@ -237,7 +237,9 @@ void RenderingServerDefault::init() {
|
||||
void RenderingServerDefault::finish() {
|
||||
if (create_thread) {
|
||||
command_queue.push(this, &RenderingServerDefault::_thread_exit);
|
||||
if (thread.is_started()) {
|
||||
thread.wait_to_finish();
|
||||
}
|
||||
} else {
|
||||
_finish();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user