{"action":"created","issue":{"url":"https://api.github.com/repos/wxWidgets/wxWidgets/issues/502","repository_url":"https://api.github.com/repos/wxWidgets/wxWidgets","labels_url":"https://api.github.com/repos/wxWidgets/wxWidgets/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/wxWidgets/wxWidgets/issues/502/comments","events_url":"https://api.github.com/repos/wxWidgets/wxWidgets/issues/502/events","html_url":"https://github.com/wxWidgets/wxWidgets/pull/502","id":236580109,"number":502,"title":"Improve BSTR handling in MSW code","user":{"login":"pbfordev","id":12495521,"avatar_url":"https://avatars0.githubusercontent.com/u/12495521?v=3","gravatar_id":"","url":"https://api.github.com/users/pbfordev","html_url":"https://github.com/pbfordev","followers_url":"https://api.github.com/users/pbfordev/followers","following_url":"https://api.github.com/users/pbfordev/following{/other_user}","gists_url":"https://api.github.com/users/pbfordev/gists{/gist_id}","starred_url":"https://api.github.com/users/pbfordev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbfordev/subscriptions","organizations_url":"https://api.github.com/users/pbfordev/orgs","repos_url":"https://api.github.com/users/pbfordev/repos","events_url":"https://api.github.com/users/pbfordev/events{/privacy}","received_events_url":"https://api.github.com/users/pbfordev/received_events","type":"User","site_admin":false},"labels":[{"id":325561746,"url":"https://api.github.com/repos/wxWidgets/wxWidgets/labels/MSW","name":"MSW","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-16T20:01:48Z","updated_at":"2017-06-22T15:17:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/wxWidgets/wxWidgets/pulls/502","html_url":"https://github.com/wxWidgets/wxWidgets/pull/502","diff_url":"https://github.com/wxWidgets/wxWidgets/pull/502.diff","patch_url":"https://github.com/wxWidgets/wxWidgets/pull/502.patch"},"body":"As reported in [wxTrac ticket #17889](https://groups.google.com/forum/?fromgroups#!topic/wx-dev/KTlBHnKKS8U), there may be `BSTR`s leaked in `wxWebView` code. wxWidgets currently don't have the RAII wrapper for `BSTR`.  There is `wxBasicString` but it cannot be created from `BSTR`, nor it can attach or detach a `BSTR`. \r\n\r\nThis PR introduces `wxBSTR` which is a `BSTR` RAII wrapper as well `wxBasicString` replacement. I opted for different name instead of modifying `wxBasicString` as I did not find `wxBasicString` API well suited for an RAII class (e.g. `BSTR wxBasicString::Get() const` actually returning a copy of owned `BSTR`) and I also wanted the name of the class to clearly indicate its close relationship to `BSTR`. \r\n"},"comment":{"url":"https://api.github.com/repos/wxWidgets/wxWidgets/issues/comments/310411713","html_url":"https://github.com/wxWidgets/wxWidgets/pull/502#issuecomment-310411713","issue_url":"https://api.github.com/repos/wxWidgets/wxWidgets/issues/502","id":310411713,"user":{"login":"vadz","id":146917,"avatar_url":"https://avatars3.githubusercontent.com/u/146917?v=3","gravatar_id":"","url":"https://api.github.com/users/vadz","html_url":"https://github.com/vadz","followers_url":"https://api.github.com/users/vadz/followers","following_url":"https://api.github.com/users/vadz/following{/other_user}","gists_url":"https://api.github.com/users/vadz/gists{/gist_id}","starred_url":"https://api.github.com/users/vadz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadz/subscriptions","organizations_url":"https://api.github.com/users/vadz/orgs","repos_url":"https://api.github.com/users/vadz/repos","events_url":"https://api.github.com/users/vadz/events{/privacy}","received_events_url":"https://api.github.com/users/vadz/received_events","type":"User","site_admin":false},"created_at":"2017-06-22T15:17:19Z","updated_at":"2017-06-22T15:17:19Z","body":"Unfortunately `wxBasicString` does seem to be used outside of wxWidgets, even if it was never really meant to, see e.g. [this](https://github.com/axelstudios/wex/blob/3300f82f78c9f3d6fef86ce46369661d268e8a78/src/ole/excelauto.cpp#L52). So we probably need to keep it, although we could deprecate it.\r\n\r\nOTOH maybe it would be sufficient to deprecate its `Get()` method which is, indeed, quite poorly named? We could rename it to `Copy()` (if it's needed) and add `Detach()` and a ctor from `BSTR`, what do you think?"}}
{"actor":{"display_login":"vadz"}}