summaryrefslogtreecommitdiff
path: root/src/network/core/tcp_content.cpp
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-05-30 12:47:50 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-06-10 20:09:44 +0200
commit9c424ab741218238205e8d1f2644a3912fda250a (patch)
tree3aa21fe1a71c5d7ed3ec69259b72aa40e1358b30 /src/network/core/tcp_content.cpp
parentdfb89f3891ec73b4d5a6f46092ad825dabec6bb7 (diff)
downloadopenttd-9c424ab741218238205e8d1f2644a3912fda250a.tar.xz
Codechange: [ContentInfo] Use StringList for tags instead of custom allocations
Diffstat (limited to 'src/network/core/tcp_content.cpp')
-rw-r--r--src/network/core/tcp_content.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/network/core/tcp_content.cpp b/src/network/core/tcp_content.cpp
index ddea9fd5e..041e932e4 100644
--- a/src/network/core/tcp_content.cpp
+++ b/src/network/core/tcp_content.cpp
@@ -25,7 +25,7 @@ ContentInfo::ContentInfo()
: /* Temporary... will be removed later in the PR. */
type((ContentType)0), id((ContentID)0), filesize(0), filename(""), name(""), version(""),
url(""), description(""), unique_id(0), md5sum(""), dependency_count(0), dependencies(nullptr),
- tag_count(0), tags(nullptr), state((State)0), upgrade(false)
+ state((State)0), upgrade(false)
{
}
@@ -33,7 +33,6 @@ ContentInfo::ContentInfo()
ContentInfo::~ContentInfo()
{
free(this->dependencies);
- free(this->tags);
}
/**
@@ -44,10 +43,9 @@ void ContentInfo::TransferFrom(ContentInfo *other)
{
if (other != this) {
free(this->dependencies);
- free(this->tags);
*this = *other;
other->dependencies = nullptr;
- other->tags = nullptr;
+ other->tags.clear();
}
}