diff options
author | flow <flowlnlnln@gmail.com> | 2022-12-20 16:27:15 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2023-01-13 16:23:07 -0300 |
commit | 38e20eb1486928e10f4d3c128f3e9a6c697d872a (patch) | |
tree | a725c17301784d75ee894d816d3b4a5673d898ca /launcher/modplatform | |
parent | 36571c5e2237c98e194cff326480ebe3e661c586 (diff) | |
download | PrismLauncher-38e20eb1486928e10f4d3c128f3e9a6c697d872a.tar.gz PrismLauncher-38e20eb1486928e10f4d3c128f3e9a6c697d872a.tar.bz2 PrismLauncher-38e20eb1486928e10f4d3c128f3e9a6c697d872a.zip |
fix(RD): pass copy of IndexedPack to callbacks instead of ref.
This prevents a crash in which the pack list gets updated in a search
request meanwhile a versions / extra info request is being processed.
Previously, this situation would cause the reference in the latter
callbacks to be invalidated by an internal relocation of the pack list.
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/modplatform')
-rw-r--r-- | launcher/modplatform/ResourceAPI.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/launcher/modplatform/ResourceAPI.h b/launcher/modplatform/ResourceAPI.h index a2078b94..5f4e1832 100644 --- a/launcher/modplatform/ResourceAPI.h +++ b/launcher/modplatform/ResourceAPI.h @@ -81,7 +81,7 @@ class ResourceAPI { }; struct VersionSearchArgs { - ModPlatform::IndexedPack& pack; + ModPlatform::IndexedPack pack; std::optional<std::list<Version> > mcVersions; std::optional<ModLoaderTypes> loaders; @@ -94,16 +94,16 @@ class ResourceAPI { } }; struct VersionSearchCallbacks { - std::function<void(QJsonDocument&, ModPlatform::IndexedPack&)> on_succeed; + std::function<void(QJsonDocument&, ModPlatform::IndexedPack)> on_succeed; }; struct ProjectInfoArgs { - ModPlatform::IndexedPack& pack; + ModPlatform::IndexedPack pack; void operator=(ProjectInfoArgs other) { pack = other.pack; } }; struct ProjectInfoCallbacks { - std::function<void(QJsonDocument&, ModPlatform::IndexedPack&)> on_succeed; + std::function<void(QJsonDocument&, ModPlatform::IndexedPack)> on_succeed; }; public: |