Clang will soon start emitting warnings for mismatch uses of new and
delete.  In testing this upcoming feature of Clang, I found a
mismatched new/delete pair in matplotlib.  I've applied the following
patch in my local tree, but I see that the problem still exists in
trunk.

The problem here is that the constructor for
ExtensionClassMethodsTable() is allocating an array of
m_methods_table, so it should be deallocated with delete[].

If this is OK for trunk, could someone apply this patch, please?


Thanks.  Diego.

--- a/lib/matplotlib/src/CXX/Python2/ExtensionType.hxx
+++ b/lib/matplotlib/src/CXX/Python2/ExtensionType.hxx
@@ -125,7 +125,7 @@ namespace Py

         ~ExtensionClassMethodsTable()
         {
-            delete m_methods_table;
+            delete[] m_methods_table;
         }

         // check that all methods added are unique

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to