Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
c1298e69
Unverified
Commit
c1298e69
authored
Jul 15, 2021
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐛
fix leak for strings
parent
6cbdc839
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
include/nlohmann/detail/conversions/to_json.hpp
include/nlohmann/detail/conversions/to_json.hpp
+4
-1
No files found.
include/nlohmann/detail/conversions/to_json.hpp
View file @
c1298e69
...
@@ -236,7 +236,10 @@ template<typename BasicJsonType, typename CompatibleString,
...
@@ -236,7 +236,10 @@ template<typename BasicJsonType, typename CompatibleString,
enable_if_t
<
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleString
>
::
value
,
int
>
=
0
>
enable_if_t
<
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleString
>
::
value
,
int
>
=
0
>
void
to_json
(
BasicJsonType
&
j
,
const
CompatibleString
&
s
)
void
to_json
(
BasicJsonType
&
j
,
const
CompatibleString
&
s
)
{
{
j
.
m_value
.
destroy
(
j
.
m_type
);
if
(
!
j
.
is_null
())
{
j
=
nullptr
;
}
external_constructor
<
value_t
::
string
>::
construct
(
j
,
s
);
external_constructor
<
value_t
::
string
>::
construct
(
j
,
s
);
}
}
...
...
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