File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/main/com/intellij/lang/jsgraphql/ide/project/schemastatus Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,9 @@ public boolean isToBuildChildrenInBackground(Object element) {
118118 application .executeOnPooledThread (() -> {
119119 // run the schema discovery on a pooled to prevent blocking of the UI thread by asking the nodes for heir child nodes
120120 // the schema caches will be ready when the UI thread then needs to show the tree nodes
121+ if (myProject .isDisposed ()) {
122+ return ;
123+ }
121124 try {
122125 application .runReadAction (() -> {
123126 // use read action to enable use of indexes
@@ -145,6 +148,8 @@ public boolean isToBuildChildrenInBackground(Object element) {
145148 // update the tree after being idle for a short while
146149 IdeEventQueue .getInstance ().addIdleListener (treeUpdater , 750 );
147150
151+ Disposer .register (myProject , () -> IdeEventQueue .getInstance ().removeIdleListener (treeUpdater ));
152+
148153 // update tree on schema or config changes
149154 final MessageBusConnection connection = myProject .getMessageBus ().connect ();
150155 connection .subscribe (GraphQLSchemaChangeListener .TOPIC , (schemaVersion ) -> {
You can’t perform that action at this time.
0 commit comments