Skip to content

Commit

Permalink
Add deleter for parsed examples (#2153)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgerrits committed Nov 22, 2019
1 parent 87798f4 commit f032eaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/pylibvw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ py::list my_parse(vw_ptr& all, char* str)
for (auto ex : examples)
{
VW::setup_example(*all, ex);
example_collection.append(ex);
example_collection.append(
boost::shared_ptr<example>(ex, [all](example* example) { VW::finish_example(*all.get(), *example); }));
}
examples.clear();
examples.delete_v();
Expand Down

0 comments on commit f032eaf

Please sign in to comment.