Skip to content

Commit

Permalink
Prevent crashes when the QgsApplication is deleted in headless mode
Browse files Browse the repository at this point in the history
Force delete the `QgsProject`, otherwise the `QgsApplication` might be
deleted by the time the project is garbage collected
  • Loading branch information
suricactus committed Mar 18, 2024
1 parent d1cd75d commit c7a3aea
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 c7a3aea

Please sign in to comment.