diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2026-10-12 09:59:31 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2026-10-12 09:59:31 +0200 |
| commit | 0f795c8b22aa8c159792305d9c6b7aaab0707281 (patch) | |
| tree | d5784dc856281b6797d0c46ffeb6dfa34505cccd | |
| parent | 19e25ab70e3f47045ad3d54ed7bf0b9415561707 (diff) | |
solve device init bug if thread_aware
| -rw-r--r-- | src/vkvg_device.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/vkvg_device.c b/src/vkvg_device.c index 2922df3..6b805e4 100644 --- a/src/vkvg_device.c +++ b/src/vkvg_device.c @@ -134,6 +134,12 @@ void _device_init(VkvgDevice dev, const vkvg_device_create_info_t* info) { _device_create_empty_texture(dev, format, dev->supportedTiling); + if (dev->threadAware) { + mtx_init(&dev->mutex, mtx_plain); + mtx_init(&dev->fontCache->mutex, mtx_plain); + dev->threadAware = true; + } + #ifdef DEBUG #if defined(__linux__) && defined(__GLIBC__) _linux_register_error_handler(); @@ -301,11 +307,6 @@ VkvgDevice vkvg_device_create(vkvg_device_create_info_t* info) { dev->references = 1; dev->threadAware = info->threadAware; - if (dev->threadAware) { - mtx_init(&dev->mutex, mtx_plain); - mtx_init(&dev->fontCache->mutex, mtx_plain); - dev->threadAware = true; - } if (!info->vkdev) { const char* enabledExts[10]; |