Commit Graph

16 Commits

Author SHA1 Message Date
Mark Rowe 152697d199 Add the linking objects property type. 2016-06-06 11:49:29 -07:00
Thomas Goyne f4e5049f47 Add basic string formatting for error messages
The main motivation for this is that building error messages via string
concatenation is tedious and makes it hard to judge what the actual message
looks like when there are a lot of parts being inserted, to the extent that
I've been tempted to leave out some potentially useful information because the
code was getting unwieldy.

It also has some small functional benefits: bools are printed as true/false
rather than 1/0, and it is optimized for minimizing the compiled size.
Currently it cuts ~30 KB off librealm-object-store.dylib even with the addition
of new functionality.
2016-06-03 13:19:42 -07:00
Mark Rowe 65a748de0c Fix move-assigning to a `Results` that has a notifier to not leak the
`Realm`, and moving from a `Results` to not result in a use-after-free.

The compiler generated move-assignment operator resulted in `m_notifier`
being assigned to without first calling `CollectionNotifier::unregister`.
This left a retain cycle in place, causing the `Realm` and other objects
to leak.

`ResultsNotifier` keeps track of which `Results` it should update when a
new `TableView` becomes available. When `Results` move-assignment
operator and move-constructor transfer ownership of the
`ResultsNotifier` to a new instance they also need to update its target
so it won't attempt to update the moved-from `Results`.
2016-05-31 19:03:29 -07:00
Thomas Goyne 03108713ee Make PropertyType an enum class 2016-05-11 16:08:30 -07:00
Thomas Goyne 4cf5d5db4c Report modification paths as pre-delete/inserts as required for UITableView 2016-05-11 16:08:30 -07:00
Thomas Goyne c0350b9001 Rename CollectionChangeIndices to CollectionChangeSet 2016-05-11 16:08:30 -07:00
Thomas Goyne bab5540cf6 Fix incorrect results when the second-to-last row is deleted 2016-05-11 16:08:30 -07:00
Thomas Goyne 20d9da973b Make List and Results notifications more consistent
Deliver the initial results for both of them and include the changeset
in the initial delivery for both, rather than having them behave weirdly
differently.
2016-05-11 16:08:30 -07:00
Thomas Goyne 7f5277a97b Run RealmCoordinator::on_change() on a different thread when using tsan 2016-05-11 16:08:30 -07:00
Thomas Goyne 9503a3fc03 Always send an empty changeset to the first call of a Results notification callback 2016-05-11 16:08:30 -07:00
Thomas Goyne e65ad4d413 Discard moves which are turned into no-ops when merging 2016-05-11 16:08:30 -07:00
Thomas Goyne a428f813d5 Skip calling callbacks if two commits cancel each other out when merged 2016-05-11 16:08:30 -07:00
Thomas Goyne e25e4c2dcd Rework handling of mixed move_last_over() and modifications to actually work 2016-05-11 16:08:30 -07:00
Thomas Goyne d46f2c65ba Refactor the transaction log parsers to eliminate some duplication 2016-05-11 16:08:30 -07:00
Thomas Goyne f4aaa7c9de Add fine-grained notifications for Results 2016-05-11 16:08:30 -07:00
Thomas Goyne 086192f8d3 Add minimal Results notification tests 2016-02-26 10:24:46 -08:00