Ticket #880 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Memory management in C++ classes.

Reported by: Noughmad Owned by: Noughmad
Milestone: QtGraph Final Component: canvas
Severity: minor Keywords:
Cc: Blocking:
Blocked By:

Description

The SIP interface to the C++ classes contain the /Transfer/ and /TransferBack/ annotations, but not in all places. This leads to memory leaks, when objects are not deleted but their wrappers are.

The lack of these annotations in the NetworkCurve also leads to crashes, because objects are delete twice, once in C++ and once in Python.

Because NetworkCurve's methods work on lists, not individual points, some handwritten code will have to be added to the SIP files, that will transfer the ownership to C++ and back.

See:  http://www.riverbankcomputing.co.uk/static/Docs/sip4/using.html#ref-object-ownership,  http://www.riverbankcomputing.co.uk/static/Docs/sip4/c_api.html#sipGetPyObject,

Change History

comment:1 Changed 3 years ago by Noughmad

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.