- 17 Feb, 2016 1 commit
-
-
Filip Roséen authored
I wrote a hackish script to locate instances where new can throw but where the original author has assumed that it will return nullptr when there is a memory allocation problem. In short, cases such as `ptr = new T; if (ptr) ...` has now been changed to `ptr = new (std::nothrow) T; if (ptr) ...`. Since a throwing `new` will always yield a non-nullptr pointer, code that follows similar patterns to the previous example are therefor redundant. Example (from modules/access/dshow/filter.cpp): *ppEnum = new CaptureEnumMediaTypes( p_input, p_pin, this ); if( *ppEnum == NULL ) return E_OUTOFMEMORY; // unreachable, new will never return NULL Fixed: *ppEnum = new (std::nothrow) CaptureEnumMediaTypes( p_input, p_pin, this ); if( *ppEnum == NULL ) return E_OUTOFMEMORY; Signed-off-by:
Hugo Beauzée-Luyssen <hugo@beauzee.fr>
-
- 30 Oct, 2015 1 commit
-
-
François Cartegnie authored
-
- 09 Sep, 2015 2 commits
-
-
François Cartegnie authored
-
François Cartegnie authored
-
- 06 Aug, 2015 1 commit
-
-
Jean-Baptiste Kempf authored
-
- 24 Jul, 2015 1 commit
-
-
François Cartegnie authored
-
- 10 Jun, 2015 1 commit
-
-
François Cartegnie authored
-
- 15 May, 2015 1 commit
-
-
François Cartegnie authored
-
- 30 Apr, 2015 2 commits
-
-
François Cartegnie authored
-
François Cartegnie authored
also fixes includes, forward declarations
-
- 26 Dec, 2014 1 commit
-
-
François Cartegnie authored
-
- 18 Dec, 2014 3 commits
-
-
François Cartegnie authored
-
François Cartegnie authored
-
François Cartegnie authored
-