Destructor for cstringstream
This commit is contained in:
@@ -15,11 +15,17 @@ kcp::cstringstream::cstringstream()
|
|||||||
this->size = 0;
|
this->size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kcp::cstringstream::~cstringstream()
|
||||||
|
{
|
||||||
|
delete this->string;
|
||||||
|
}
|
||||||
|
|
||||||
kcp::cstringstream& kcp::cstringstream::operator<<(char c) {
|
kcp::cstringstream& kcp::cstringstream::operator<<(char c) {
|
||||||
this->string = (const char *)Memory::g_allocator->Realloc((void *)this->string, this->size + 1);
|
this->string = (const char *)Memory::g_allocator->Realloc((void *)this->string, this->size + 1);
|
||||||
|
|
||||||
if (!this->string)
|
if (!this->string)
|
||||||
{
|
{
|
||||||
|
kerr << "Streaming failed due to failed allocation" << Kt::newline;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace kcp {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
cstringstream();
|
cstringstream();
|
||||||
|
~cstringstream();
|
||||||
|
|
||||||
cstringstream& operator<<(char c);
|
cstringstream& operator<<(char c);
|
||||||
cstringstream& operator<<(char* str);
|
cstringstream& operator<<(char* str);
|
||||||
|
|||||||
Reference in New Issue
Block a user