Skip to content

Memory leak when PyErr_SetObject is used #485

@pyscripter

Description

@pyscripter

The pattern

PyErr_SetObject(PyExc_TypeError^, PyUnicodeFromString(
          Format(rs_ErrInvalidArgs,
          ['CreateComponent', rs_InvalidClass])));

is used in WrapDelphi and elsewhere. The problem with that is that the created Unicode python object is not released and over time this increases memory consumption.

See also https://en.delphipraxis.net/topic/12229-how-to-release-memory-used-by-exceptions/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions