summaryrefslogtreecommitdiff
path: root/configmgr/source/writemodfile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'configmgr/source/writemodfile.cxx')
-rw-r--r--configmgr/source/writemodfile.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx
index 3df150c448cd..29d4b18c49bf 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -75,20 +75,21 @@ OString convertToUtf8(std::u16string_view text) {
} // anonymous namespace
TempFile::~TempFile() {
- if (handle != nullptr) {
- if (!closed) {
- oslFileError e = osl_closeFile(handle);
- if (e != osl_File_E_None) {
- SAL_WARN("configmgr", "osl_closeFile failed with " << +e);
- }
- }
- osl::FileBase::RC e = osl::File::remove(url);
- if (e != osl::FileBase::E_None) {
- SAL_WARN(
- "configmgr",
- "osl::File::remove(" << url << ") failed with " << +e);
+ if (handle == nullptr)
+ return;
+
+ if (!closed) {
+ oslFileError e = osl_closeFile(handle);
+ if (e != osl_File_E_None) {
+ SAL_WARN("configmgr", "osl_closeFile failed with " << +e);
}
}
+ osl::FileBase::RC e = osl::File::remove(url);
+ if (e != osl::FileBase::E_None) {
+ SAL_WARN(
+ "configmgr",
+ "osl::File::remove(" << url << ") failed with " << +e);
+ }
}
#ifdef _WIN32