Revert "prevent memory corruption in dbengine" (#19364)
Revert "prevent memory corruption in dbengine (#19363)" This reverts commit 50fb61d54a22600c3dada553e974d091ba76a4d1.
Costa Tsaousis committed
Jan 10, 2025 at 00:06 UTC
d447f55128751b79ef507287d28e3c1a6e2556f7
1 file changed
+2
-2
src/database/engine/rrdengineapi.c
+2
-2
@@ -911,8 +911,8 @@ void rrdeng_load_metric_finalize(struct storage_engine_query_handle *seqh)
911
pgdc_reset(&handle->pgdc, NULL, UINT32_MAX);
912
}
913
914
- __atomic_store_n(&handle->pdc->workers_should_stop, true, __ATOMIC_RELAXED);
915
- pdc_release_and_destroy_if_unreferenced(handle->pdc, false, false);
914
+ if(!pdc_release_and_destroy_if_unreferenced(handle->pdc, false, false))
915
+ __atomic_store_n(&handle->pdc->workers_should_stop, true, __ATOMIC_RELAXED);
916
917
unregister_query_handle(handle);
918
rrdeng_query_handle_release(handle);