Bug 1797766 Comment 6 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Jens Stutte [:jstutte] from comment #5)
> (In reply to Andrew Sutherland [:asuth] (he/him) from comment #4)
> > So I think we want to null out mTransaction [in the IDBTypedCursor destructor](https://searchfox.org/mozilla-central/rev/2809416b216b498ec3d8b0e65c25a135f4f5f37d/dom/indexedDB/IDBCursor.h#258).
> 
> We seem to do this already inside [`BackgroundCursorChild<CursorType>::SendDeleteMeInternal`](https://searchfox.org/mozilla-central/rev/2809416b216b498ec3d8b0e65c25a135f4f5f37d/dom/indexedDB/ActorsChild.cpp#2839), should we then do it before [` DropJSObjects();`](https://searchfox.org/mozilla-central/rev/2809416b216b498ec3d8b0e65c25a135f4f5f37d/dom/indexedDB/IDBCursor.cpp#57) ?

To be clear (as the phrasing was ambiguous), BackgroundCursorChild drops its own, distinct (Maybe<> reference) mTransaction in SendDeleteMeInternal, but the IDBTypedCursor has its own mTransaction.

I would null it out it after `DropJSObjects()` just because I don't see an advantage to dropping it before and it seems like [IDBTypedCursor::Reset](https://searchfox.org/mozilla-central/rev/a3decf626dabd89620171f0ea7840cc4351fe218/dom/indexedDB/IDBCursor.cpp#178) has enough going on inside it that it wouldn't be tremendously surprising if an access was made to mTransaction in the future, and it does seem reasonable for that cleanup logic to potentially need to do things like that.
(In reply to Jens Stutte [:jstutte] from comment #5)
> (In reply to Andrew Sutherland [:asuth] (he/him) from comment #4)
> > So I think we want to null out mTransaction [in the IDBTypedCursor destructor](https://searchfox.org/mozilla-central/rev/2809416b216b498ec3d8b0e65c25a135f4f5f37d/dom/indexedDB/IDBCursor.h#258).
> 
> We seem to do this already inside [`BackgroundCursorChild<CursorType>::SendDeleteMeInternal`](https://searchfox.org/mozilla-central/rev/2809416b216b498ec3d8b0e65c25a135f4f5f37d/dom/indexedDB/ActorsChild.cpp#2839), should we then do it before [` DropJSObjects();`](https://searchfox.org/mozilla-central/rev/2809416b216b498ec3d8b0e65c25a135f4f5f37d/dom/indexedDB/IDBCursor.cpp#57) ?

To be clear (as the phrasing was ambiguous), BackgroundCursorChild drops its own, distinct (Maybe<> reference) mTransaction in SendDeleteMeInternal, but the IDBTypedCursor has its own mTransaction.

I would null it out it after `DropJSObjects()` just because I don't see an advantage to dropping it before and it seems like [IDBTypedCursor::Reset](https://searchfox.org/mozilla-central/rev/a3decf626dabd89620171f0ea7840cc4351fe218/dom/indexedDB/IDBCursor.cpp#178) which is called by its [DropObjects](https://searchfox.org/mozilla-central/rev/a3decf626dabd89620171f0ea7840cc4351fe218/dom/indexedDB/IDBCursor.cpp#126) has enough going on inside it that it wouldn't be tremendously surprising if an access was made to mTransaction in the future, and it does seem reasonable for that cleanup logic to potentially need to do things like that.

Back to Bug 1797766 Comment 6