New submission from STINNER Victor: tracemalloc cannot be used in object destructors because the module is stopped early at Python shutdown.
I would like to use tracemalloc.get_object_traceback() in object destructors to retrieve where an object was allocated. Attached patch replaces the atexit handler with a builtin _PyTraceMalloc_Fini() function to stop tracemalloc much later. It does also simplify the C code of _tracemalloc.c. ---------- files: tracemalloc_fini.patch keywords: patch messages: 204717 nosy: haypo, neologix, pitrou priority: normal severity: normal status: open title: tracemalloc: stop the module later versions: Python 3.4 Added file: http://bugs.python.org/file32887/tracemalloc_fini.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19831> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com