fix a crash of API::root

This commit is contained in:
Jinhao 2015-10-14 22:20:51 +08:00
parent b160e5e833
commit cb4bb7d60e
2 changed files with 4 additions and 2 deletions

View File

@ -8,7 +8,7 @@
* http://www.boost.org/LICENSE_1_0.txt) * http://www.boost.org/LICENSE_1_0.txt)
* *
* @file: nana/gui/place.cpp * @file: nana/gui/place.cpp
* @contributors: qPCR4vir * @contributors: Ariel Vina-Rodriguez
*/ */
#include <cfloat> #include <cfloat>

View File

@ -442,7 +442,9 @@ namespace API
native_window_type root(window wd) native_window_type root(window wd)
{ {
internal_scope_guard lock; internal_scope_guard lock;
if(is_window(wd))
return reinterpret_cast<basic_window*>(wd)->root; return reinterpret_cast<basic_window*>(wd)->root;
return nullptr;
} }
window root(native_window_type wd) window root(native_window_type wd)