Fix DialogBrowse crashing when deleting the last item nullptr. In iOS use std::recursive_mutex instead of the custom check.
This commit is contained in:
@@ -39,23 +39,26 @@ int t_count = 0;
|
||||
glm::vec2 t_pos;
|
||||
int lock_count = 0;
|
||||
NSThread* lock_thread;
|
||||
std::recursive_mutex lock_mutex;
|
||||
|
||||
@implementation GameViewController
|
||||
- (void)async_lock
|
||||
{
|
||||
if (lock_thread != [NSThread currentThread] || lock_count == 0)
|
||||
[gl_lock lock];
|
||||
lock_thread = [NSThread currentThread];
|
||||
lock_count++;
|
||||
lock_mutex.lock();
|
||||
// if (lock_thread != [NSThread currentThread] || lock_count == 0)
|
||||
// [gl_lock lock];
|
||||
// lock_thread = [NSThread currentThread];
|
||||
// lock_count++;
|
||||
[EAGLContext setCurrentContext:self.context];
|
||||
GLKView* view = (GLKView*)self.view;
|
||||
[view bindDrawable];
|
||||
}
|
||||
- (void)async_unlock
|
||||
{
|
||||
lock_count--;
|
||||
if (lock_count == 0)
|
||||
[gl_lock unlock];
|
||||
// lock_count--;
|
||||
// if (lock_count == 0)
|
||||
// [gl_lock unlock];
|
||||
lock_mutex.unlock();
|
||||
}
|
||||
- (void)async_swap
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user