Skip to content

Commit

Permalink
Fix destructor mismatch that caused random heap corruption (#972)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RyanUnderhill authored Oct 14, 2024
1 parent 0f59a90 commit 7998f13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ort_genai_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ void OGA_API_CALL OgaDestroyString(const char* p) {
}

void OGA_API_CALL OgaDestroySequences(OgaSequences* p) {
delete reinterpret_cast<Generators::Sequences*>(p);
delete reinterpret_cast<Generators::TokenSequences*>(p);
}

void OGA_API_CALL OgaDestroyModel(OgaModel* p) {
Expand Down

0 comments on commit 7998f13

Please sign in to comment.