mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-16 21:50:11 +02:00
Properly initialize the thread local objects
Instead of doing assignment. Assignment will probably reinitialize every cycle, and it also didn't work on one person's computer.
This commit is contained in:
@@ -212,11 +212,8 @@ class Vst3MessageHandler : public AdHocSocketHandler<Thread> {
|
|||||||
// process data, since that's the only object where allocations can
|
// process data, since that's the only object where allocations can
|
||||||
// happen. The other objects we're storing here are very small, so the
|
// happen. The other objects we're storing here are very small, so the
|
||||||
// extra wasted memory shouldn't matter much.
|
// extra wasted memory shouldn't matter much.
|
||||||
// FIXME: This of course doesn't work. The variant will have been
|
thread_local std::optional<Request> persistent_object(
|
||||||
// reconstructed when the next process cycle hits, so we don't
|
persistent_buffers ? std::make_optional<Request>() : std::nullopt);
|
||||||
// gain anything from this.
|
|
||||||
thread_local std::optional<Request> persistent_object =
|
|
||||||
persistent_buffers ? std::make_optional<Request>() : std::nullopt;
|
|
||||||
|
|
||||||
// Reading, processing, and writing back the response for the requests
|
// Reading, processing, and writing back the response for the requests
|
||||||
// we receive works in the same way regardless of which socket we're
|
// we receive works in the same way regardless of which socket we're
|
||||||
|
|||||||
Reference in New Issue
Block a user