Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gpt4all-backend/llama.cpp-mainline
1 change: 1 addition & 0 deletions gpt4all-chat/chatlistmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ class ChatListModel : public QAbstractListModel
m_newChat = nullptr;
m_serverChat = nullptr;
m_currentChat = nullptr;
for (auto * chat: m_chats) { delete chat; }
m_chats.clear();
}

Expand Down
4 changes: 3 additions & 1 deletion gpt4all-chat/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ int main(int argc, char *argv[])
}
#endif

int res = app.exec();

// Make sure ChatLLM threads are joined before global destructors run.
// Otherwise, we can get a heap-use-after-free inside of llama.cpp.
ChatListModel::globalInstance()->clearChats();

return app.exec();
return res;
}