Skip to content

Commit

Permalink
🐛 Fixed the issue where the chrome-driver chrome-headless-shell proce…
Browse files Browse the repository at this point in the history
…ss was not closed when the application exited (#757)
  • Loading branch information
guiyanakuang authored Apr 18, 2024
1 parent 3620ed3 commit ea9ead4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ package com.clipevery.clip
interface ChromeService {

fun html2Image(html: String): ByteArray?

fun quit()
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ object DesktopChromeService : ChromeService {
}
}

override fun quit() {
chromeDriver?.quit()
}

@Suppress("UNCHECKED_CAST")
private fun doHtml2Image(html: String): ByteArray? {
chromeDriver?.let { driver ->
Expand Down
2 changes: 2 additions & 0 deletions composeApp/src/desktopMain/kotlin/com/clipevery/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.ui.window.rememberWindowState
import com.clipevery.app.AppFileType
import com.clipevery.app.AppUI
import com.clipevery.clean.CleanClipScheduler
import com.clipevery.clip.ChromeService
import com.clipevery.clip.ClipSearchService
import com.clipevery.clip.ClipboardService
import com.clipevery.listen.GlobalListener
Expand Down Expand Up @@ -49,6 +50,7 @@ fun exitClipEveryApplication(exitApplication: () -> Unit) {
koinApplication.koin.get<ClipBonjourService>().unregisterService()
koinApplication.koin.get<ClipServer>().stop()
koinApplication.koin.get<CleanClipScheduler>().stop()
koinApplication.koin.get<ChromeService>().quit()
exitApplication()
}

Expand Down

0 comments on commit ea9ead4

Please sign in to comment.