Boost logo

Ublas :

From: Bart Janssen (bart.j.janssen_at_[hidden])
Date: 2008-08-14 08:41:53


Hello,

I experienced de-allocation problems in the UMFPACK bindings.
The diff you find below fixes the bug by adding a constructor to the
symbolic_type and numeric_type structs that are defined in bindings/
umfpack/umfpack.hpp .
The ptr variable will now be initialized to 0.

Can someone add this to the svn repository?

Kind Regards,
Bart Janssen

result of "svn diff":
Index: umfpack.hpp
===================================================================
--- umfpack.hpp (revision 48136)
+++ umfpack.hpp (working copy)
@@ -30,6 +30,7 @@
    template <typename T = double>
    struct symbolic_type : private noncopyable {
      void *ptr;
+ symbolic_type():ptr(0){};
      ~symbolic_type() {
        if (ptr)
          detail::free_symbolic (T(), 0, &ptr);
@@ -47,6 +48,7 @@
    template <typename T = double>
    struct numeric_type : private noncopyable {
      void *ptr;
+ numeric_type():ptr(0){};
      ~numeric_type() {
        if (ptr)
          detail::free_numeric (T(), 0, &ptr);