small cleanups

This commit is contained in:
Henry Hiles 2026-09-24 20:59:18 -04:00
commit c7b89b8e56
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 14 additions and 8 deletions

View file

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

View file

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