<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Reset is not virtual in any way, so I believe it is ok to call it in the destructor. 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.<div><br></div><div><div><div>On Dec 12, 2012, at 3:19 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt"><div dir="ltr"><div class="gmail_extra">On Wed, Dec 12, 2012 at 2:59 PM, Pedro Artigas <span dir="ltr"><<a href="mailto:partigas@apple.com" target="_blank" class="cremed">partigas@apple.com</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":579"> MCContext::~MCContext() {<br>

<br>
-  if (AutoInitializationFinalization)<br>
-    doFinalization();<br>
+  if (AutoReset)<br>
+    reset();</div></blockquote></div><br></div><div class="gmail_extra" style="">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></div>
<div class="gmail_extra" style=""><br></div><div class="gmail_extra" style="">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?</div>
</div></div>
</blockquote></div><br></div></body></html>