summaryrefslogtreecommitdiff
path: root/unotest
diff options
context:
space:
mode:
Diffstat (limited to 'unotest')
-rw-r--r--unotest/source/python/org/libreoffice/unotest.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/unotest/source/python/org/libreoffice/unotest.py b/unotest/source/python/org/libreoffice/unotest.py
index 8b421e167c0c..e27f9e145de4 100644
--- a/unotest/source/python/org/libreoffice/unotest.py
+++ b/unotest/source/python/org/libreoffice/unotest.py
@@ -243,11 +243,12 @@ class UnoInProcess:
assert(self.xContext)
def tearDown(self):
if hasattr(self, 'xDoc'):
- self.xDoc.close(True)
- # HACK in case self.xDoc holds a UNO proxy to an SwXTextDocument (whose dtor calls
- # Application::GetSolarMutex via sw::UnoImplPtrDeleter), which would potentially only be
- # garbage-collected after VCL has already been deinitialized:
- self.xDoc = None
+ if self.xDoc:
+ self.xDoc.close(True)
+ # HACK in case self.xDoc holds a UNO proxy to an SwXTextDocument (whose dtor calls
+ # Application::GetSolarMutex via sw::UnoImplPtrDeleter), which would potentially only be
+ # garbage-collected after VCL has already been deinitialized:
+ self.xDoc = None
def simpleInvoke(connection, test):
try: