small cleanups
This commit is contained in:
parent
721727d48c
commit
c7b89b8e56
2 changed files with 14 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ final class ChatScroll<T>({
|
|||
if (position.extentAfter <= topThreshold) {
|
||||
await loadOlder();
|
||||
} else if (position.extentBefore <= bottomThreshold) {
|
||||
onReachedBottom();
|
||||
await onReachedBottom();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue