Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
1c16df5a
Commit
1c16df5a
authored
Nov 01, 2016
by
Guolin Ke
Committed by
GitHub
Nov 01, 2016
Browse files
set init_score_ = nullptr after delete
parent
b3e99b27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/io/metadata.cpp
src/io/metadata.cpp
+2
-0
No files found.
src/io/metadata.cpp
View file @
1c16df5a
...
@@ -124,6 +124,7 @@ void Metadata::CheckOrPartition(data_size_t num_all_data, const std::vector<data
...
@@ -124,6 +124,7 @@ void Metadata::CheckOrPartition(data_size_t num_all_data, const std::vector<data
if
(
init_score_
!=
nullptr
&&
num_init_score_
!=
num_data_
)
{
if
(
init_score_
!=
nullptr
&&
num_init_score_
!=
num_data_
)
{
delete
[]
init_score_
;
delete
[]
init_score_
;
Log
::
Error
(
"Initial score size doesn't equal to data, score file will be ignored"
);
Log
::
Error
(
"Initial score size doesn't equal to data, score file will be ignored"
);
init_score_
=
nullptr
;
num_init_score_
=
0
;
num_init_score_
=
0
;
}
}
}
else
{
}
else
{
...
@@ -148,6 +149,7 @@ void Metadata::CheckOrPartition(data_size_t num_all_data, const std::vector<data
...
@@ -148,6 +149,7 @@ void Metadata::CheckOrPartition(data_size_t num_all_data, const std::vector<data
Log
::
Error
(
"Initial score size doesn't equal to data , initial scores will be ignored"
);
Log
::
Error
(
"Initial score size doesn't equal to data , initial scores will be ignored"
);
delete
[]
init_score_
;
delete
[]
init_score_
;
num_init_score_
=
0
;
num_init_score_
=
0
;
init_score_
=
nullptr
;
}
}
// get local weights
// get local weights
...
...
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