<p dir="ltr"><br>
On Dec 12, 2012 3:27 PM, "Pedro Artigas" <<a href="mailto:partigas@apple.com">partigas@apple.com</a>> wrote:<br>
><br>
> Reset is not virtual in any way, so I believe it is ok to call it in the destructor.</p>
<p dir="ltr">Oh doh... I looked at the wrong reset. Sorry about that....<br><br></p>
<p dir="ltr"> It frees some memory (ideally it would not, it would clear the maps but I do not know if that has the same behavior, if so I can change it) which would leak otherwise.</p>
<p dir="ltr">Not sure either without looking closer... anyways sorry for noise<br></p>
<p dir="ltr">><br>
> On Dec 12, 2012, at 3:19 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br>
><br>
>> On Wed, Dec 12, 2012 at 2:59 PM, Pedro Artigas <<a href="mailto:partigas@apple.com">partigas@apple.com</a>> wrote:<br>
>>><br>
>>>  MCContext::~MCContext() {<br>
>>><br>
>>> -  if (AutoInitializationFinalization)<br>
>>> -    doFinalization();<br>
>>> +  if (AutoReset)<br>
>>> +    reset();<br>
>><br>
>><br>
>> I don't think this does what you want it to... This is a virtual function, and so it seems like a bad idea: <a href="http://www.artima.com/cppsource/nevercall.html">http://www.artima.com/cppsource/nevercall.html</a><br>

>><br>
>> That said, I don't think we need the functionality of MCContext's reset in the destructor -- won't the normal destructor do what you want anyways?<br>
><br>
><br>
</p>