Skip to content

Commit 7998f13

Browse files
Fix destructor mismatch that caused random heap corruption (#972)
I don't know how this ever worked, but it's totally fair that I was the one to suffer for it since I wrote the original line of code. In something I was working on, genai would crash randomly with heap corruption. I finally figured out it was this line that was the culprit. I'll think about renaming things so nobody else gets confused like I did.
1 parent 0f59a90 commit 7998f13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ort_genai_c.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ void OGA_API_CALL OgaDestroyString(const char* p) {
544544
}
545545

546546
void OGA_API_CALL OgaDestroySequences(OgaSequences* p) {
547-
delete reinterpret_cast<Generators::Sequences*>(p);
547+
delete reinterpret_cast<Generators::TokenSequences*>(p);
548548
}
549549

550550
void OGA_API_CALL OgaDestroyModel(OgaModel* p) {

0 commit comments

Comments
 (0)