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) {
118
118
application .executeOnPooledThread (() -> {
119
119
// run the schema discovery on a pooled to prevent blocking of the UI thread by asking the nodes for heir child nodes
120
120
// the schema caches will be ready when the UI thread then needs to show the tree nodes
121
+ if (myProject .isDisposed ()) {
122
+ return ;
123
+ }
121
124
try {
122
125
application .runReadAction (() -> {
123
126
// use read action to enable use of indexes
@@ -145,6 +148,8 @@ public boolean isToBuildChildrenInBackground(Object element) {
145
148
// update the tree after being idle for a short while
146
149
IdeEventQueue .getInstance ().addIdleListener (treeUpdater , 750 );
147
150
151
+ Disposer .register (myProject , () -> IdeEventQueue .getInstance ().removeIdleListener (treeUpdater ));
152
+
148
153
// update tree on schema or config changes
149
154
final MessageBusConnection connection = myProject .getMessageBus ().connect ();
150
155
connection .subscribe (GraphQLSchemaChangeListener .TOPIC , (schemaVersion ) -> {
You can’t perform that action at this time.
0 commit comments