Compare commits

...
Author SHA1 Message Date
bd1d73e692
fix crash on startup 2026-09-24 22:00:01 -04:00
c7b89b8e56
small cleanups 2026-09-24 20:59:18 -04:00
2 changed files with 11 additions and 7 deletions

View file

@ -57,12 +57,15 @@ class ClientController extends AsyncNotifier<int> {
for (final MapEntry(:key, :value) in env.entries) { for (final MapEntry(:key, :value) in env.entries) {
final keyPtr = key.toNativeUtf8().cast<Char>(); final keyPtr = key.toNativeUtf8().cast<Char>();
final valuePtr = value.toNativeUtf8().cast<Char>(); final valuePtr = value.toNativeUtf8().cast<Char>();
try {
GomuksSetEnv(keyPtr, valuePtr); GomuksSetEnv(keyPtr, valuePtr);
} finally {
calloc calloc
..free(keyPtr) ..free(keyPtr)
..free(valuePtr); ..free(valuePtr);
} }
} }
}
debugPrint("Initializing Gomuks..."); debugPrint("Initializing Gomuks...");
final handle = await Isolate.run(() { final handle = await Isolate.run(() {
@ -107,8 +110,9 @@ class ClientController extends AsyncNotifier<int> {
return json; return json;
} finally { } finally {
calloc.free(bufferPointer.ref.base); calloc
calloc.free(bufferPointer); ..free(bufferPointer.ref.base)
..free(bufferPointer);
} }
} }

View file

@ -71,7 +71,7 @@ final class ChatScroll<T>({
if (position.extentAfter <= topThreshold) { if (position.extentAfter <= topThreshold) {
await loadOlder(); await loadOlder();
} else if (position.extentBefore <= bottomThreshold) { } else if (position.extentBefore <= bottomThreshold) {
onReachedBottom(); await onReachedBottom();
} }
} }