Skip to content

Exception is thrown on IDE shutdown #211#212

Closed
Vassiliy-Kudryashov wants to merge 1 commit intomainfrom
Vassiliy-Kudryashov/211-exception-is-thrown-on-ide-shutdown
Closed

Exception is thrown on IDE shutdown #211#212
Vassiliy-Kudryashov wants to merge 1 commit intomainfrom
Vassiliy-Kudryashov/211-exception-is-thrown-on-ide-shutdown

Conversation

@Vassiliy-Kudryashov
Copy link
Member

Description

Obtained ModifiableRootModel should be disposed or committed, otherwise the resource is considered as 'leaked'

Fixes #211

Type of Change

  • Minor bug fix (non-breaking small changes)

How Has This Been Tested?

Manual Scenario

  1. Start IDE with plugin
  2. Open "Generate tests with UtBot" dialog
  3. Close the dialog, exit IDE
    No exception should be seen in log

Checklist (remove irrelevant options):

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • No new warnings

@Vassiliy-Kudryashov Vassiliy-Kudryashov linked an issue Jun 15, 2022 that may be closed by this pull request
@Vassiliy-Kudryashov Vassiliy-Kudryashov requested review from EgorkaKulikov and removed request for denis-fokin June 16, 2022 08:25
private fun staticsMockingConfigured(): Boolean {
val entries = ModuleRootManager.getInstance(model.testModule).modifiableModel.contentEntries
val modifiableModel = ModuleRootManager.getInstance(model.testModule).modifiableModel
Disposer.register(disposable) { modifiableModel.dispose() }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be the disposable disposed on the window close?

@Vassiliy-Kudryashov
Copy link
Member Author

Actually here we don't need modifiableModel at all, ModuleRootManager.getInstance(model.testModule).contentEntries is enough (see change a60f372 and PR #238)

@Vassiliy-Kudryashov Vassiliy-Kudryashov deleted the Vassiliy-Kudryashov/211-exception-is-thrown-on-ide-shutdown branch July 6, 2022 14:18
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.

Exception is thrown on IDE shutdown

2 participants