Skip to content

Commit 86d9f15

Browse files
committed
fix double free
1 parent 267f8af commit 86d9f15

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tools/server/server-context.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,18 +711,18 @@ struct server_context_impl {
711711
void destroy() {
712712
llama_init.reset();
713713

714-
ctx = nullptr;
715-
model = nullptr;
716-
717-
mtmd_free(mctx);
718-
mctx = nullptr;
719-
720714
for (server_slot & slot : slots) {
721715
if (slot.can_speculate()) {
722716
slot.spec.reset();
723717
}
724718
}
725719

720+
ctx = nullptr;
721+
model = nullptr;
722+
723+
mtmd_free(mctx);
724+
mctx = nullptr;
725+
726726
llama_batch_free(batch);
727727
}
728728

0 commit comments

Comments
 (0)