Fix reply rendering infinite loop bug
This commit is contained in:
@ -29,7 +29,9 @@ import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"time"
|
||||
dbg "runtime/debug"
|
||||
|
||||
"maunium.net/go/mautrix"
|
||||
"maunium.net/go/mautrix/format"
|
||||
@ -232,6 +234,11 @@ func (c *Container) OnLogin() {
|
||||
debug.Print("Adding rooms to UI")
|
||||
c.ui.MainView().SetRooms(c.config.Rooms)
|
||||
c.ui.Render()
|
||||
// The initial sync can be a bit heavy, so we force run the GC here
|
||||
// after cleaning up rooms from memory above.
|
||||
debug.Print("Running GC")
|
||||
runtime.GC()
|
||||
dbg.FreeOSMemory()
|
||||
}
|
||||
c.client.Syncer = c.syncer
|
||||
|
||||
|
@ -148,6 +148,9 @@ func (room *Room) Load() {
|
||||
room.lock.Lock()
|
||||
room.load()
|
||||
room.lock.Unlock()
|
||||
if room.postLoad != nil {
|
||||
room.postLoad()
|
||||
}
|
||||
}
|
||||
|
||||
func (room *Room) load() {
|
||||
@ -177,9 +180,6 @@ func (room *Room) load() {
|
||||
debug.Print("Failed to decode room state:", err)
|
||||
}
|
||||
room.changed = false
|
||||
if room.postLoad != nil {
|
||||
room.postLoad()
|
||||
}
|
||||
}
|
||||
|
||||
func (room *Room) Touch() {
|
||||
|
Reference in New Issue
Block a user