forked from osmocom/wireshark
Qt: fix crash when opening/saving IP map on Windows
According to https://bugreports.qt.io/browse/QTBUG-20372 you need to close
a QFile before calling fclose, otherwise it leads to an unexpected behavior.
Let's duplicate the file handle to avoid this issue as suggested in
https://stackoverflow.com/questions/9465727/convert-qfile-to-file
Closes #17074
(cherry picked from commit 746051d099
)
This commit is contained in:
parent
747a03de06
commit
b621801877
|
@ -223,7 +223,8 @@ QUrl EndpointDialog::createMap(bool json_only)
|
|||
g_free(hosts);
|
||||
return QUrl();
|
||||
}
|
||||
FILE* fp = ws_fdopen(fd, "wb");
|
||||
// duplicate file descriptor as it is not allowed to perform a fclose before closing QFile
|
||||
FILE* fp = ws_fdopen(ws_dup(fd), "wb");
|
||||
if (fp == NULL) {
|
||||
QMessageBox::warning(this, tr("Map file error"), tr("Unable to create temporary file"));
|
||||
g_free(hosts);
|
||||
|
|
Loading…
Reference in New Issue