Skip to content

Commit

Permalink
* fix memory leaks in so_multiclass_BMRM example
Browse files Browse the repository at this point in the history
  • Loading branch information
iglesias committed Sep 2, 2012
1 parent ad4ac3c commit 2482cb1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/undocumented/libshogun/so_multiclass_BMRM.cpp
Expand Up @@ -240,7 +240,9 @@ int main(int argc, char * argv[])

for (uint32_t i=0; i<num_feat; ++i)
{
error+=(( (CRealNumber*) out->get_label(i) )->value==labs.get_element(i)) ? 0.0 : 1.0;
CRealNumber* rn = CRealNumber::obtain_from_generic( out->get_label(i) );
error+=(rn->value==labs.get_element(i)) ? 0.0 : 1.0;
SG_UNREF(rn); // because of out->get_label(i) above
}

SG_SPRINT("Error = %lf %% \n", error/num_feat*100);
Expand Down

0 comments on commit 2482cb1

Please sign in to comment.