Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix a couple of memory leaks in so example (mostly unnecessary SG_REF's
of newly created objects that are returned)
- Loading branch information
Soeren Sonnenburg
committed
Aug 31, 2012
1 parent
958ce8f
commit 9e92392
Showing
3 changed files
with
11 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,6 @@ CStructuredLabels* CLinearStructuredOutputMachine::apply_structured(CFeatures* d | |
} | ||
} | ||
SG_UNREF(model_features); | ||
SG_REF(out); | ||
return out; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sonney2k
via email
Member
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why is it that we do not have to do SG_REF here? Since the object out is created
in this method and it is the return value I was confident that it should be done in
that way.
However, I have checked the others apply_* and see that SG_REF is not done
there either. What have I understood wrong?