Skip to content

port to smart pointers

Harald Sitter requested to merge work/smartptr into master

on errors.ubuntu.com and the window partner center there are odd crashes on bad pointers that I can't quite place. as a short in the dark lets use smart pointers instead of raw pointers to keep things alive as long as they need to rather than as long as we think they need to. in particular duplication was a bit dodgy there. that said, duplication is why we need shared ptrs, otherwise we'd probably have gotten by with unique_ptrs.

had the additional advantage of forcing me to revisit the qobject use in file/folder, which is now gone since it is pointless (qml wouldn't know what to do with shared_ptr) instead the single use for it is now part of the item itself, a bit questionable from an OOP POV but at the same time it saves us the overhead of N qobjects.

all in all this should improve memory safety substantially.

Merge request reports

Loading