Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory behavior of functions taking wchar_t pointers is not documented #10

Open
realnc opened this issue Nov 9, 2017 · 1 comment
Open

Comments

@realnc
Copy link

realnc commented Nov 9, 2017

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?
@dkager
Copy link
Owner

dkager commented Nov 9, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants