pass const ref to func in queueInMainThread

This commit is contained in:
ConfiG 2024-01-15 00:39:36 +03:00
parent 516a1c67da
commit 3e840cdb47
No known key found for this signature in database
GPG key ID: 44DA1983F524C11B
2 changed files with 2 additions and 2 deletions

View file

@ -691,7 +691,7 @@ bool Loader::Impl::loadHooks() {
return !hadErrors; return !hadErrors;
} }
void Loader::Impl::queueInMainThread(ScheduledFunction func) { void Loader::Impl::queueInMainThread(const ScheduledFunction& func) {
std::lock_guard<std::mutex> lock(m_mainThreadMutex); std::lock_guard<std::mutex> lock(m_mainThreadMutex);
m_mainThreadQueue.push_back(func); m_mainThreadQueue.push_back(func);
} }

View file

@ -112,7 +112,7 @@ namespace geode {
void updateResources(bool forceReload); void updateResources(bool forceReload);
void queueInMainThread(ScheduledFunction func); void queueInMainThread(const ScheduledFunction& func);
void executeMainThreadQueue(); void executeMainThreadQueue();
bool isReadyToHook() const; bool isReadyToHook() const;