mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:04:06 +00:00
Don't pass the AppHooks as pointer
It's not permitted to pass a nullptr to the `app_hooks_update`. So a reference should be used. CppCheck says one shouldn't take pointer to a temporary.
This commit is contained in:
@@ -208,12 +208,11 @@ void InitVfs(const CmdLineArgs& args)
|
||||
psSetLogDir(logs);
|
||||
// desired location for crashlog is now known. update AppHooks ASAP
|
||||
// (particularly before the following error-prone operations):
|
||||
AppHooks hooks{
|
||||
app_hooks_update({
|
||||
.get_log_dir = psLogDir,
|
||||
.bundle_logs = psBundleLogs,
|
||||
.display_error = psDisplayError
|
||||
};
|
||||
app_hooks_update(&hooks);
|
||||
});
|
||||
|
||||
g_VFS = CreateVfs();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user