Compare commits

..
2 changed files with 7 additions and 11 deletions

View file

@ -57,15 +57,12 @@ 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(() {
@ -110,9 +107,8 @@ class ClientController extends AsyncNotifier<int> {
return json; return json;
} finally { } finally {
calloc calloc.free(bufferPointer.ref.base);
..free(bufferPointer.ref.base) calloc.free(bufferPointer);
..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) {
await onReachedBottom(); onReachedBottom();
} }
} }