Stop using raw pointers for owning Audio{In|Out}putStreams |
||
Issue description
Currently, raw pointers to streams denote ownership (sometimes), meaning that the holder of the pointer must call Close on it to avoid leaking resources. This can be quite confusing and error prone (there have probably been a few bugs due to this, though I cannot remember on the top of my head). Ideal would be to use the destructor instead of Close for cleaning up streams, but some streams have their memory released by the AudioManager, or have some other special arrangement for cleanup. It would probably be easier to have owning pointers in a smart pointer like
"using UniqueAudioInputStreamPtr = std::unique_ptr<AudioInputStream, AudioStreamCloser>", where AudioStreamCloser calls Close. This wouldn't require updating all the Audio{In,Out}putStream implementations.
Possibly a good starter bug?
,
Sep 25 2017
Yes, RAII FTW
,
Oct 25 2017
Im a newbie to chromium and aware of usage of RAII pattern, would like to take up this work. Can someone throw some light on the pointers which needs to be replaced with RAII pattern. Thanks,
,
Oct 25 2017
Is there any some reference already been implemented? plz guide Thanks
,
Oct 25
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
||
►
Sign in to add a comment |
||
Comment 1 by dalecur...@chromium.org
, Sep 25 2017