summaryrefslogtreecommitdiff
path: root/tests/giomm_simple/main.cc
diff options
context:
space:
mode:
authorChun-wei Fan <fanc999@yahoo.com.tw>2023-01-05 12:33:40 +0800
committerChun-wei Fan <fanc999@yahoo.com.tw>2023-01-05 12:33:40 +0800
commit974c1e6638feed8365bb697c8c60677952ccd6fa (patch)
tree5cde398a58dd7832f646ddf9cab9790b3d34cb24 /tests/giomm_simple/main.cc
parent699fb49a70038a682fcc381108fc283d12ba48bc (diff)
downloadglibmm-974c1e6638feed8365bb697c8c60677952ccd6fa.tar.gz
Fix giomm_simple test on Windows
One normally cannot attempt to remove (delete) a file on Windows if it is still open, so we must close the resources that are tied to the file before attempting to delete it. Without doing so, the test program will fail on Windows as an exception is caught as the file->remove() call failed since the associated iostream is still open.
Diffstat (limited to 'tests/giomm_simple/main.cc')
-rw-r--r--tests/giomm_simple/main.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/giomm_simple/main.cc b/tests/giomm_simple/main.cc
index 7d28466a..263f972d 100644
--- a/tests/giomm_simple/main.cc
+++ b/tests/giomm_simple/main.cc
@@ -92,6 +92,7 @@ main(int, char**)
std::cerr << "Gio::InputStream::read() read: " << buffer << std::endl;
return EXIT_FAILURE;
}
+ iostream->close();
file->remove();
}
catch (const Glib::FileError& ex)