Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- committed Feb 12, 2025
1 parent d2970e7 commit 5149484
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ class VaadinCompileOnSaveAction : ActionsOnSaveFileDocumentManagerListener.Actio
compileLock.acquire()
LOG.debug("Compile starting for $javaFiles")

val myConn = myProject!!.messageBus.connect()
val messageBusConnection = getProject().messageBus.connect()
val listener =
object : ProjectTaskListener {
override fun finished(result: ProjectTaskManager.Result) {
LOG.debug("Compile completed for $javaFiles")
compileLock.release()
myConn.disconnect()
messageBusConnection.disconnect()
}
}

myConn.subscribe<ProjectTaskListener>(ProjectTaskListener.TOPIC, listener)
messageBusConnection.subscribe<ProjectTaskListener>(ProjectTaskListener.TOPIC, listener)

ReadAction.run<Throwable> {
HotSwapUI.getInstance(project).compileAndReload(session, *javaFiles.toTypedArray())
Expand Down

0 comments on commit 5149484

Please sign in to comment.