You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The recent buffer changes mean that view->obj may be set even on error when exporting a buffer. Previously, we probably never set view->obj if an error occurred (I did not double check).
Technically, the Python documentation says we should NULL object, but de-facto not even Python does it, and any consumer should just not make assumption if the buffer export fails!
Python also has one (or two) code places that actually rely on view->len not being initialized on error, I think those should probably be fixed, but if someone wants to be particularly clean, we could just leave view->len uninitialized until after all possible errors are handled. (In most places handling errors up-front is easier anyway)
Note: I may look into some time (and it would be good to fix), but its also not super high priority, since we never NULL'ed object it seems very unlikely anyone relies on us not touching it... See also: https://bugs.python.org/issue43608
(I stumbled upon this randomly, because I missed an actual, absolutely harmless, reference count leak on our side...)
The text was updated successfully, but these errors were encountered:
The recent buffer changes mean that
view->obj
may be set even on error when exporting a buffer. Previously, we probably never setview->obj
if an error occurred (I did not double check).Technically, the Python documentation says we should
NULL
object, but de-facto not even Python does it, and any consumer should just not make assumption if the buffer export fails!Python also has one (or two) code places that actually rely on
view->len
not being initialized on error, I think those should probably be fixed, but if someone wants to be particularly clean, we could just leaveview->len
uninitialized until after all possible errors are handled. (In most places handling errors up-front is easier anyway)Note: I may look into some time (and it would be good to fix), but its also not super high priority, since we never
NULL
'edobject
it seems very unlikely anyone relies on us not touching it... See also: https://bugs.python.org/issue43608(I stumbled upon this randomly, because I missed an actual, absolutely harmless, reference count leak on our side...)
The text was updated successfully, but these errors were encountered: