summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_resource_preview.cpp10
-rw-r--r--editor/editor_resource_preview.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 40482dc367..3c401a6fc7 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -217,7 +217,7 @@ void EditorResourcePreview::_thread() {
exited = false;
while (!exit) {
- preview_sem->wait();
+ preview_sem.wait();
preview_mutex.lock();
if (queue.size()) {
@@ -379,7 +379,7 @@ void EditorResourcePreview::queue_edited_resource_preview(const Ref<Resource> &p
queue.push_back(item);
}
- preview_sem->post();
+ preview_sem.post();
}
void EditorResourcePreview::queue_resource_preview(const String &p_path, Object *p_receiver, const StringName &p_receiver_func, const Variant &p_userdata) {
@@ -403,7 +403,7 @@ void EditorResourcePreview::queue_resource_preview(const String &p_path, Object
queue.push_back(item);
}
- preview_sem->post();
+ preview_sem.post();
}
void EditorResourcePreview::add_preview_generator(const Ref<EditorResourcePreviewGenerator> &p_generator) {
@@ -462,7 +462,7 @@ void EditorResourcePreview::start() {
void EditorResourcePreview::stop() {
if (thread) {
exit = true;
- preview_sem->post();
+ preview_sem.post();
while (!exited) {
OS::get_singleton()->delay_usec(10000);
VisualServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on visual server
@@ -476,7 +476,6 @@ void EditorResourcePreview::stop() {
EditorResourcePreview::EditorResourcePreview() {
thread = NULL;
singleton = this;
- preview_sem = SemaphoreOld::create();
order = 0;
exit = false;
exited = false;
@@ -485,5 +484,4 @@ EditorResourcePreview::EditorResourcePreview() {
EditorResourcePreview::~EditorResourcePreview() {
stop();
- memdelete(preview_sem);
}
diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h
index ae347c0469..0e1684963c 100644
--- a/editor/editor_resource_preview.h
+++ b/editor/editor_resource_preview.h
@@ -71,7 +71,7 @@ class EditorResourcePreview : public Node {
List<QueueItem> queue;
Mutex preview_mutex;
- SemaphoreOld *preview_sem;
+ Semaphore preview_sem;
Thread *thread;
volatile bool exit;
volatile bool exited;