> On May 11, 2015, 10:19 p.m., Ben Mahler wrote:
> > src/slave/slave.cpp, line 155
> > <https://reviews.apache.org/r/34016/diff/1/?file=954524#file954524line155>
> >
> >     unique_ptr is not a POD, so this will still try to run the destructor 
> > of the function during exit of the program.
> >     
> >     Can you just use a raw pointer here and leak it? (Not ideal but we use 
> > this in many places)

Yes, I use raw pointer before. But got this error
```
../../src/slave/slave.cpp:519:19: error: cannot convert 
‘process::_Deferred<std::_Bind<std::_Mem_fn<void (std::function<void(int, 
int)>::*)(int, int)const>(std::function<void(int, int)>, std::_Placeholder<1>, 
std::_Placeholder<2>)> >’ to ‘std::function<void(int, int)>*’ in assignment   
signaledWrapper = defer(self(), &Slave::signaled, lambda::_1, lambda::_2);
```
So I use unique_ptr. Let me remove unique_ptr and add force convert here.


- haosdent


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34016/#review83299
-----------------------------------------------------------


On May 9, 2015, 5:07 p.m., haosdent huang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34016/
> -----------------------------------------------------------
> 
> (Updated May 9, 2015, 5:07 p.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Change the type of signaledWrapper to unique_ptr
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.cpp bf290bfd7d9a59ce7197ce34cbd8cf42e7dd17a3 
> 
> Diff: https://reviews.apache.org/r/34016/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> haosdent huang
> 
>

Reply via email to