Make a deep copy of our filename in RecentFileStatus.
authorGerald Combs <gerald@wireshark.org>
Fri, 2 Feb 2018 17:37:50 +0000 (09:37 -0800)
committerMichael Mann <mmann78@netscape.net>
Sat, 3 Feb 2018 02:06:49 +0000 (02:06 +0000)
commita4bb6c2d395ac1e30e116bc2780fa143df2dc1ab
tree923c124c701506c8e3508b73abdf13ae9579ff4a
parente3a76761861cf3baad8e9c998345be59bc725a2b
Make a deep copy of our filename in RecentFileStatus.

QStrings are implictly shared as described at
http://doc.qt.io/qt-5/implicit-sharing.html. This is normally useful,
but RecentFileStatus is passed a QString before it does its work in a
separate thread.

Make a deep copy of the filename in order to ensure local ownership and
to avoid having to fool around with a QMutex (which might not be
recognized by ThreadSanitizer[1] or Helgrind[2]).

Remove getFilename since it was unused.

[1] https://github.com/google/sanitizers/issues/460
[2] http://valgrind.org/docs/manual/hg-manual.html

Change-Id: I5b5c329505ed8c02d30043a2a6d1ded625924b9f
Reviewed-on: https://code.wireshark.org/review/25572
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
ui/qt/recent_file_status.cpp
ui/qt/recent_file_status.h