Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading another project leads to crash #833

Closed
TheJackiMonster opened this issue Feb 22, 2021 · 2 comments · Fixed by #834
Closed

Loading another project leads to crash #833

TheJackiMonster opened this issue Feb 22, 2021 · 2 comments · Fixed by #834
Labels
Milestone

Comments

@TheJackiMonster
Copy link
Collaborator

I tried to debug another issue (I tried to reproduce a hang) and I encountered a crash which is quite consistently if you have multiple projects.

  • Open manuskript
  • Open a recent project A
  • Close project A
  • Open a recent project B
  • It crashes
bin/manuskript
Debug: Web rendering engine used: QWebView
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Running manuskript version 0.11.0.
Preferred translation: manuskript_de.qm (based on user setting)
Loaded translation: manuskript_de.qm
"/proc/20476/root"
Loading: /home/thejackimonster/Cloud/Manuskript/Test2.msk
Detected file format version: 1. Zip: False.
Projekt /home/thejackimonster/Cloud/Manuskript/Test2.msk geladen.
Loading: /home/thejackimonster/Cloud/Manuskript/Test.msk
Detected file format version: 1. Zip: True.
Projekt /home/thejackimonster/Cloud/Manuskript/Test.msk geladen.
Traceback (most recent call last):
  File "/home/thejackimonster/github/manuskript/bin/../manuskript/ui/welcome.py", line 146, in loadRecentFile
    self.mw.loadProject(act.data())
  File "/home/thejackimonster/github/manuskript/bin/../manuskript/mainWindow.py", line 593, in loadProject
    self.makeConnections()
  File "/home/thejackimonster/github/manuskript/bin/../manuskript/mainWindow.py", line 955, in makeConnections
    self.btnAddPerso.clicked.connect(self.lstCharacters.addCharacter, F.AUC)
TypeError: connection is not unique
Fatal Python error: Aborted

Current thread 0x00007f0c6a00e740 (most recent call first):
  File "/home/thejackimonster/github/manuskript/bin/../manuskript/main.py", line 221 in launch
  File "/home/thejackimonster/github/manuskript/bin/../manuskript/main.py", line 234 in run
  File "/home/thejackimonster/github/manuskript/bin/manuskript", line 13 in <module>
make: *** [makefile:10: run] Aborted (core dumped)

So if I understand this correctly manuskript seems to keep data from one project which leads to a crash loading a different one. Restarting manuskript to load a different project works because the application doesn't contain any data of a project during a fresh start. Fixing this could also fix some other bugs and crashes around saving and loading projects.

@BentleyJOakes
Copy link
Contributor

Apologies, this was caused by my previous pull request. I've made a new pull request that adds the code to do the disconnection.

Two code smells stand out to me in the mainWindow.py:

  • The use of a try/except/pass on line 956, and
  • The required duplication of the addition/removal of connections. Maybe these should be stored so that they can be automatically unhooked?

@TheJackiMonster
Copy link
Collaborator Author

You are definitely right. This code for hooking in events and unhooking them looks extremely unpleasant. ^^'

I would prefer adding in a class which stores all connections to easily connect and disconnect all with ease.

@TheJackiMonster TheJackiMonster added this to the 0.12.0 milestone Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants