[mlpack-git] [mlpack] removing global dependency on cli deleter (#521)

Joseph Mariadassou notifications at github.com
Wed Feb 24 21:36:45 EST 2016


This explains why cliDeleter is working. At least in one of the translation
units cliDeleter is contructed after Log::info. Hence that deleter sets
'singleton' to NULL. Subsequent calls to CLI::Destroy has no effect. Also
in the following code:
if (singleton != NULL)
  {
    delete singleton;
    singleton = NULL; // Reset pointer.
  }

The 'if' condition is redundant.



On Thu, Feb 25, 2016 at 1:18 PM, Ryan Curtin <notifications at github.com>
wrote:

> Nice catch! You are absolutely correct, and that indeed is not something
> that is wanted. :)
>
> I added std::cout << "delete CLI\n"; to CLIDeleter::~CLIDeleter() and got
> some lovely output at the end of an mlpack_allknn run:
>
> ...
> [INFO ] Program timers:
> [INFO ]   computing_neighbors: 0.059620s
> [INFO ]   loading_data: 0.005533s
> [INFO ]   total_time: 0.068139s
> [INFO ]   tree_building: 0.001401s
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
> delete CLI!
>
>> Reply to this email directly or view it on GitHub
> <https://github.com/mlpack/mlpack/pull/521#issuecomment-188567853>.
>



-- 
Joseph Chakravarti Mariadassou
http://thesundayprogrammer.com


---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/521#issuecomment-188571950
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160224/bce9b77b/attachment.html>


More information about the mlpack-git mailing list