diff --git a/libcef_dll/ctocpp/ctocpp_scoped.h b/libcef_dll/ctocpp/ctocpp_scoped.h index 8b32de704..39ff502aa 100644 --- a/libcef_dll/ctocpp/ctocpp_scoped.h +++ b/libcef_dll/ctocpp/ctocpp_scoped.h @@ -147,9 +147,11 @@ StructName* CefCToCppScoped::UnwrapOwn( StructName* orig_struct = wrapperStruct->struct_; +#if DCHECK_IS_ON() // We should own the object currently. cef_base_scoped_t* base = reinterpret_cast(orig_struct); DCHECK(base && base->del); +#endif // Don't delete the original object when the wrapper is deleted. wrapperStruct->struct_ = NULL;