Skip to content

fixed EditMidiMappingModel destruction#32760

Open
igorkorsukov wants to merge 1 commit intomusescore:masterfrom
igorkorsukov:w/ioc/step_30
Open

fixed EditMidiMappingModel destruction#32760
igorkorsukov wants to merge 1 commit intomusescore:masterfrom
igorkorsukov:w/ioc/step_30

Conversation

@igorkorsukov
Copy link
Contributor

@igorkorsukov igorkorsukov commented Mar 24, 2026

Resolves:
#32720
#32735

In the destructor of the Qml object, it is no longer our QmlContext, we cannot get the iocContext.
Solution options:

  1. We can check whether we really need to do something in the destructor (as in this PR)
  2. We need to call the injectors before calling the destructor, just call them, they will receive the context, receive the service from the IOC, and after that they will no longer figure out the context and access the IOC.

@krasko78
Copy link
Contributor

krasko78 commented Mar 24, 2026

Should also resolve #32735 (unless there are more Preferences models that need to be fixed in the same way).

@shoogle
Copy link
Contributor

shoogle commented Mar 24, 2026

Tested on:

  • Windows: x86_64 native
  • macOS: ARM64 native
  • Ubuntu 24.04: ARM64 inside UTM virtual machine under macOS

Result:

  • Windows: No change. App still crashes for me on creating a score.
  • macOS: I was able to load a score and get work done, but the app did eventually crash.
  • Linux: App no longer crashes.

It's a big improvement on Linux and macOS so perhaps we should merge this now and iterate later?

@igorkorsukov
Copy link
Contributor Author

Tested on:

  • Windows: x86_64 native
  • macOS: ARM64 native
  • Ubuntu 24.04: ARM64 inside UTM virtual machine under macOS

Result:

  • Windows: No change. App still crashes for me on creating a score.
  • macOS: I was able to load a score and get work done, but the app did eventually crash.
  • Linux: App no longer crashes.

It's a big improvement on Linux and macOS so perhaps we should merge this now and iterate later?

This PR fixes a crash when closing Preferences.
The crashes you noted are related to something else, not related to this PR.
Could you please create an issue?
Or describe the crash here #32720

@shoogle shoogle mentioned this pull request Mar 24, 2026
4 tasks
@shoogle
Copy link
Contributor

shoogle commented Mar 24, 2026

@igorkorsukov, I've created a new issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants