New submission from Zuzu_Typ <zuzu....@gmail.com>: It should be considered to increase the refcount of functions that are passed on to an external library at some point.
If this is not done and e.g. the function was a local variable, when leaving the scope it gets garbage-collected. When the library now tries to execute said function, an access violation occurs. So if the refcount were increased either upon creating the CFUNCTYPE instance or when it's passed on, this could be avoided. ---------- components: ctypes messages: 316047 nosy: Zuzu_Typ priority: normal severity: normal status: open title: [ctypes] increase refcount of a CFUNCTYPE instance when passing to a CDLL type: behavior _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33406> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com