mirror of
https://github.com/status-im/status-app.git
synced 2026-08-27 07:01:14 +00:00
chore: bump nimqml-seaqt (model wrappers own their C++ object)
The model setups never set QObject.owner, so delete() silently no-oped for every model: dropping a Nim model leaked its C++ object alive with a dangling Nim pointer, and any later consumer callback (view rowCount, roleNames) was a use-after-free. This crashed the send modal when switching networks dropped token-selector rows whose nested submodels QML still referenced. https://github.com/seaqt/nimqml-seaqt/commit/87d0d12
This commit is contained in:
@@ -174,6 +174,17 @@ suite "TokenSelectorModel - nested balances submodel":
|
||||
teardown:
|
||||
spy.disable()
|
||||
|
||||
test "deleting a model actually deletes the C++ object (owner flag set)":
|
||||
# nimqml-seaqt QAbstractItemModel/ListModel/TableModel setups assign vptr but
|
||||
# never set QObject.owner, so delete() silently no-ops: the C++ model leaks
|
||||
# alive with a dangling Nim pointer, and any consumer callback afterwards
|
||||
# (view rowAt -> rowCount, ModelQuery roleNames) is a use-after-free — the
|
||||
# send-modal token-selector crash.
|
||||
let doomed = newTokenSelectorBalancesModel(@[])
|
||||
check doomed.vptr != nil
|
||||
doomed.QAbstractListModel.delete()
|
||||
check doomed.vptr == nil # delete must reach the C++ side, not early-return
|
||||
|
||||
test "balances submodel exposes the chips joined per chain":
|
||||
let m = newTokenSelectorModel()
|
||||
m.setSourceItems(@[
|
||||
|
||||
Vendored
+1
-1
Submodule vendor/nimqml-seaqt updated: acf9fe19b3...87d0d1215a
Reference in New Issue
Block a user