Destructor for cstringstream

This commit is contained in:
Daniel Hammer
2025-03-01 03:39:02 +04:00
parent 17d0bbf1bb
commit 4b366be053
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -15,11 +15,17 @@ kcp::cstringstream::cstringstream()
this->size = 0;
}
kcp::cstringstream::~cstringstream()
{
delete this->string;
}
kcp::cstringstream& kcp::cstringstream::operator<<(char c) {
this->string = (const char *)Memory::g_allocator->Realloc((void *)this->string, this->size + 1);
if (!this->string)
{
kerr << "Streaming failed due to failed allocation" << Kt::newline;
return *this;
}
+1
View File
@@ -27,6 +27,7 @@ namespace kcp {
public:
cstringstream();
~cstringstream();
cstringstream& operator<<(char c);
cstringstream& operator<<(char* str);