tolk
tolk copied to clipboard
Memory behavior of functions taking wchar_t pointers is not documented
Hello, and thanks for this library!
One thing that is not clear in the API, is who's responsible for the wchar_t* data passed to the various functions. For example, does Tolk_Output() take ownership? Should I delete it? Is it copied? In other words:
auto buf = new wchar_t[txt_len];
// ...
Talk_Output(buf);
delete[] buf; // Is this safe? Is Talk_Output() going to read from the deleted buffer?
Fair point, will see what I can do about it. In short, Tolk either creates a string for use with COM and passes that on to the screen reader, or it passes the string on directly. In the latter case the screen reader API ought to document its behavior. I don't think all of them do.