mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Clean up pointer use:
* Use unique_ptr for Actions instead of manual memory management * Use unique_ptr in KeywordDatabase * Use unique_ptr instead of shared_ptr for file formats * Don't pass shared_ptr to Reader/Writer, use references instead Also * Switch to C++17 so we can use map::try_emplace
This commit is contained in:
@@ -107,13 +107,12 @@ class CheckUpdateThread : public wxThread {
|
||||
String& the_url = settings.updates_url;
|
||||
#endif
|
||||
wxURL url(the_url);
|
||||
wxInputStream* isP = url.GetInputStream();
|
||||
unique_ptr<wxInputStream> isP(url.GetInputStream());
|
||||
if (!isP) return; // failed to get data
|
||||
InputStreamP is(isP);
|
||||
// Read version data
|
||||
// ignore errors for forwards compatability
|
||||
VersionDataP version_data;
|
||||
Reader reader(is, nullptr, _("updates"), true);
|
||||
Reader reader(*isP, nullptr, _("updates"), true);
|
||||
reader.handle(version_data);
|
||||
// has the updates url changed?
|
||||
if (!version_data->new_updates_url.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user