| 50 obj->onclosedata = userdata; |
50 obj->onclosedata = userdata; |
| 51 } |
51 } |
| 52 |
52 |
| 53 static int obj_unref(void *ptr) { |
53 static int obj_unref(void *ptr) { |
| 54 ui_object_unref(ptr); |
54 ui_object_unref(ptr); |
| |
55 return 0; |
| 55 } |
56 } |
| 56 |
57 |
| 57 void ui_mainthread_object_unref(UiObject *obj) { |
58 void ui_mainthread_object_unref(UiObject *obj) { |
| 58 // TODO: detect if this is already the main thread and call |
59 // TODO: detect if this is already the main thread and call |
| 59 // ui_object_unref directly in that case |
60 // ui_object_unref directly in that case |
| 60 ui_call_mainthread(obj_unref, obj); |
61 ui_call_mainthread(obj_unref, obj); |
| 61 } |
62 } |
| 62 |
63 |
| 63 static int doc_unref(void *ptr) { |
64 static int doc_unref(void *ptr) { |
| 64 ui_document_unref(ptr); |
65 ui_document_unref(ptr); |
| |
66 return 0; |
| 65 } |
67 } |
| 66 |
68 |
| 67 void ui_mainthread_document_unref(void *doc) { |
69 void ui_mainthread_document_unref(void *doc) { |
| 68 // TODO: see ui_mainthread_object_unref |
70 // TODO: see ui_mainthread_object_unref |
| 69 ui_call_mainthread(doc_unref, doc); |
71 ui_call_mainthread(doc_unref, doc); |