[Dune] [#661] Use Python to evaluate function strings

Dune flyspray at dune-project.org
Thu Mar 8 08:40:26 CET 2012


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#661 - Use Python to evaluate function strings
User who did this - Martin Nolte (nolte)

----------
To me the code does not look very mature. A trivial example from dunepython.hh (lines 149 - 155)

Reference& operator= (const Reference& other)
        {
            Py_XDECREF(p_);
            p_ = other.p_;
            Py_XINCREF(p_);
            return *this;
        }

This may cause the object to be deleted if you assign a reference to itself. The correct code would be

Reference& operator= (const Reference& other)
        {
            Py_XINCREF(other.p_);
            Py_XDECREF(p_);
            p_ = other.p_;
            return *this;
        }

Always increase the reference counter of the new object before decreasing the one of the old obect! Otherwise Py_XDECREF might finalize an object that is still in use.
----------

More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=661#comment3253

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list