Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
b387761e
Commit
b387761e
authored
Feb 15, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forgot to destroy object
parent
568d7595
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
json.hpp
src/json.hpp
+4
-3
json.hpp.re2c
src/json.hpp.re2c
+1
-0
No files found.
src/json.hpp
View file @
b387761e
...
...
@@ -431,7 +431,7 @@ class basic_json
}
case
(
value_t
:
:
string
)
:
{
//
m_value.string = new string_t(*other.m_value.string);
// m_value.string = new string_t(*other.m_value.string);
Allocator
<
string_t
>
alloc
;
m_value
.
string
=
alloc
.
allocate
(
1
);
alloc
.
construct
(
m_value
.
string
,
*
other
.
m_value
.
string
);
...
...
@@ -500,11 +500,12 @@ class basic_json
case
(
value_t
:
:
string
)
:
{
Allocator
<
string_t
>
alloc
;
alloc
.
destroy
(
m_value
.
string
);
alloc
.
deallocate
(
m_value
.
string
,
1
);
m_value
.
string
=
nullptr
;
//
delete m_value.string;
//
m_value.string = nullptr;
// delete m_value.string;
// m_value.string = nullptr;
break
;
}
...
...
src/json.hpp.re2c
View file @
b387761e
...
...
@@ -500,6 +500,7 @@ class basic_json
case (value_t::string):
{
Allocator<string_t> alloc;
alloc.destroy(m_value.string);
alloc.deallocate(m_value.string, 1);
m_value.string = nullptr;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment