From: Jay Freeman (saurik) Date: Fri, 17 Jan 2014 20:48:20 +0000 (-0800) Subject: Pooling an ostringstream does not pool its .str(). X-Git-Tag: v0.9.500~44 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/a2b8d7ada7c9b527d46e781a217292603379e9e0?ds=sidebyside Pooling an ostringstream does not pool its .str(). --- diff --git a/Library.cpp b/Library.cpp index 28f9395..5be04f4 100644 --- a/Library.cpp +++ b/Library.cpp @@ -204,10 +204,10 @@ CYUTF8String CYPoolCode(CYPool &pool, CYUTF8String code) { CYContext context(options); driver.program_->Replace(context); - std::ostringstream &str(pool.object()); + std::ostringstream str; CYOutput out(str, options); out << *driver.program_; - return str.str().c_str(); + return $pool.strdup(str.str().c_str()); } extern "C" bool CydgetMemoryParse(const uint16_t **data, size_t *size) {