Skip to content

Commit

Permalink
fix: ConcurrentModificationException for Event.kt and AsyncEvent.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
asforest committed Dec 25, 2022
1 parent bc78473 commit 43c29ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/kotlin/event/AsyncEvent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package com.github.asforest.mshell.event

import com.github.asforest.mshell.exception.system.ListenerAlreadyAddedException
import com.github.asforest.mshell.exception.system.ListenerNotFoundException
import io.ktor.util.collections.*

class AsyncEvent : Iterable<AsyncEvent.Listener>
{
val listeners = mutableListOf<Listener>()
val listeners = ConcurrentList<Listener>()

fun always(cb: suspend () -> Unit)
{
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/event/Event.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package com.github.asforest.mshell.event

import com.github.asforest.mshell.exception.system.ListenerAlreadyAddedException
import com.github.asforest.mshell.exception.system.ListenerNotFoundException
import io.ktor.util.collections.*

class Event : Iterable<Event.Listener>
{
val listeners = mutableListOf<Listener>()
val listeners = ConcurrentList<Listener>()

fun always(cb: () -> Unit): Listener
{
Expand Down

0 comments on commit 43c29ac

Please sign in to comment.