mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03: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
|
||||
// happen. The other objects we're storing here are very small, so the
|
||||
// extra wasted memory shouldn't matter much.
|
||||
// FIXME: This of course doesn't work. The variant will have been
|
||||
// reconstructed when the next process cycle hits, so we don't
|
||||
// gain anything from this.
|
||||
thread_local std::optional<Request> persistent_object =
|
||||
persistent_buffers ? std::make_optional<Request>() : std::nullopt;
|
||||
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
|
||||
// we receive works in the same way regardless of which socket we're
|
||||
|
||||
Reference in New Issue
Block a user