Skip to content

Commit e6e1aed

Browse files
author
okay
committed
[rmkit] use pointers for TaskQueue again
for some reason, using locals is causing termination errors on kobo clara HD when clearing layers. go back to pointer leakage
1 parent 0ec26d8 commit e6e1aed

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/rmkit/ui/task_queue.cpy

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ namespace ui:
3535
return
3636

3737

38+
thread *th = nullptr
3839
try:
39-
thread th = thread([=]() {
40+
th = new thread([=]() {
4041
count := 4
4142
while tasks.size() > 0 and count > 0:
4243
count--
@@ -50,11 +51,14 @@ namespace ui:
5051
task_m.unlock()
5152
TaskQueue::wakeup()
5253
})
53-
th.detach()
54+
th->detach()
55+
if th != nullptr
56+
delete th
5457
catch (const std::exception& e):
5558
debug "NEW THREAD EXC", e.what()
5659
TaskQueue::wakeup()
5760

61+
5862
// class: ui::TaskQueue
5963
// The task queue is a way of scheduling tasks from side threads to be run
6064
// in the UI main thread.

0 commit comments

Comments
 (0)