fixed memory leak
This commit is contained in:
parent
481f377cfe
commit
bd0be5f0af
2 changed files with 0 additions and 16 deletions
12
src/JSON.cc
12
src/JSON.cc
|
@ -22,7 +22,6 @@
|
||||||
////////////////////
|
////////////////////
|
||||||
|
|
||||||
std::mutex JSON::_token;
|
std::mutex JSON::_token;
|
||||||
bool JSON::Parser::firstCall = true;
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
|
@ -1777,17 +1776,6 @@ Initialize the JSON parser given an input stream \p _is.
|
||||||
*/
|
*/
|
||||||
JSON::Parser::Parser(std::istream& _is)
|
JSON::Parser::Parser(std::istream& _is)
|
||||||
{
|
{
|
||||||
// On first call, switch off syncing between C++ and C I/O. This call must
|
|
||||||
// be done before first I/O operation as the behavior may be undefined
|
|
||||||
// otherwise.
|
|
||||||
if (firstCall)
|
|
||||||
{
|
|
||||||
firstCall = false;
|
|
||||||
// Don't sync C++ and C I/O
|
|
||||||
// from http://www.manticmoo.com/articles/jeff/programming/c++/making-io-streams-efficient-in-c++.php
|
|
||||||
std::ios_base::sync_with_stdio(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (_is)
|
while (_is)
|
||||||
{
|
{
|
||||||
std::string input_line;
|
std::string input_line;
|
||||||
|
|
|
@ -432,10 +432,6 @@ class JSON
|
||||||
char _current {};
|
char _current {};
|
||||||
/// the position inside the input buffer
|
/// the position inside the input buffer
|
||||||
size_t _pos = 0;
|
size_t _pos = 0;
|
||||||
|
|
||||||
private:
|
|
||||||
/// variable to guard std::ios_base::sync_with_stdio
|
|
||||||
static bool firstCall;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue