Merge pull request #2902 from jnhyperion/main
[JetBrain IDE] Fix `continue-binary` process does not properly exit
This commit is contained in:
commit
37a2b21416
3 changed files with 13 additions and 4 deletions
|
|
@ -71,7 +71,6 @@ private fun getTutorialFileName(): String {
|
|||
}
|
||||
|
||||
class ContinuePluginStartupActivity : StartupActivity, Disposable, DumbAware {
|
||||
private val coroutineScope = CoroutineScope(Dispatchers.IO)
|
||||
|
||||
override fun runActivity(project: Project) {
|
||||
removeShortcutFromAction(getPlatformSpecificKeyStroke("J"))
|
||||
|
|
@ -110,6 +109,7 @@ class ContinuePluginStartupActivity : StartupActivity, Disposable, DumbAware {
|
|||
}
|
||||
|
||||
private fun initializePlugin(project: Project) {
|
||||
val coroutineScope = CoroutineScope(Dispatchers.IO)
|
||||
val continuePluginService = ServiceManager.getService(
|
||||
project,
|
||||
ContinuePluginService::class.java
|
||||
|
|
@ -234,7 +234,5 @@ class ContinuePluginStartupActivity : StartupActivity, Disposable, DumbAware {
|
|||
}
|
||||
|
||||
override fun dispose() {
|
||||
// Cleanup resources here
|
||||
coroutineScope.cancel()
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ class CoreMessenger(
|
|||
private val project: Project,
|
||||
continueCorePath: String,
|
||||
private val ideProtocolClient: IdeProtocolClient,
|
||||
coroutineScope: CoroutineScope
|
||||
val coroutineScope: CoroutineScope
|
||||
) {
|
||||
private var writer: Writer? = null
|
||||
private var reader: BufferedReader? = null
|
||||
|
|
@ -232,4 +232,11 @@ class CoreMessenger(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun killSubProcess() {
|
||||
process?.isAlive?.let {
|
||||
exitCallbacks.clear()
|
||||
process?.destroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ class ContinuePluginService(project: Project) : Disposable, DumbAware {
|
|||
|
||||
override fun dispose() {
|
||||
coroutineScope.cancel()
|
||||
coreMessenger?.coroutineScope?.let {
|
||||
it.cancel()
|
||||
coreMessenger?.killSubProcess()
|
||||
}
|
||||
}
|
||||
|
||||
fun sendToWebview(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue