Skip to content

Commit

Permalink
Merge pull request #9 from qxj/bugfix/esc_crash
Browse files Browse the repository at this point in the history
bugfix app crash when press ESC during screencapture
  • Loading branch information
ProfFan authored Jun 14, 2024
2 parents fd40ecd + 386c876 commit d760b61
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion standalone_app/Snap2LaTeX.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ def capture():
# set the qicon to a processing icon
tray.setIcon(icon_inproc)

QTimer.singleShot(1, lambda: analyze_image(temp_file, temp_dir))
if os.path.exists(temp_file):
QTimer.singleShot(1, lambda: analyze_image(temp_file, temp_dir))
else:
os.rmdir(temp_dir)
tray.setIcon(icon)

# Create the menu
menu = QMenu()
Expand Down

0 comments on commit d760b61

Please sign in to comment.