Skip to content

Commit

Permalink
Merge pull request #75 from opengisch/QF-3927-no-crash
Browse files Browse the repository at this point in the history
Prevent crashes when the `QgsApplication` is deleted in headless mode
  • Loading branch information
suricactus authored Mar 18, 2024
2 parents c20d5ef + c7a3aea commit 5ed1f87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libqfieldsync/offline_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ def _convert(self, project: QgsProject) -> None:
tmp_project.read(tmp_project_filename, read_flags)
tmp_project.readProject.disconnect(on_original_project_read)

# NOTE force delete the `QgsProject`, otherwise the `QgsApplication` might be deleted by the time the project is garbage collected
del tmp_project

self.export_folder.mkdir(parents=True, exist_ok=True)
self.total_progress_updated.emit(0, 100, self.trUtf8("Converting project…"))

Expand Down

0 comments on commit 5ed1f87

Please sign in to comment.