From 3669215da0081147ad36d6d075b80aa5d79d9d21 Mon Sep 17 00:00:00 2001 From: Tamas Lustyik Date: Tue, 28 Nov 2017 15:57:10 +0000 Subject: [PATCH] Making it possible to bridge C++ wrapper classes to C (issue #2311). --- libcef_dll/cpptoc/cpptoc_ref_counted.h | 2 +- libcef_dll/wrapper_types.h | 2 ++ tools/make_wrapper_types_header.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libcef_dll/cpptoc/cpptoc_ref_counted.h b/libcef_dll/cpptoc/cpptoc_ref_counted.h index 3e4294e5d..9fdff5dd5 100644 --- a/libcef_dll/cpptoc/cpptoc_ref_counted.h +++ b/libcef_dll/cpptoc/cpptoc_ref_counted.h @@ -143,7 +143,7 @@ class CefCppToCRefCounted : public CefBaseRefCounted { // Increment/decrement reference counts on only the underlying class. void UnderlyingAddRef() const { wrapper_struct_.object_->AddRef(); } - bool UnderlyingRelease() const { return wrapper_struct_.object_->Release(); } + void UnderlyingRelease() const { wrapper_struct_.object_->Release(); } bool UnderlyingHasOneRef() const { return wrapper_struct_.object_->HasOneRef(); } diff --git a/libcef_dll/wrapper_types.h b/libcef_dll/wrapper_types.h index a9eddad08..373ba9618 100644 --- a/libcef_dll/wrapper_types.h +++ b/libcef_dll/wrapper_types.h @@ -159,6 +159,8 @@ enum CefWrapperType { WT_X509CERTIFICATE, WT_XML_READER, WT_ZIP_READER, + + WT_LAST }; #endif // CEF_LIBCEF_DLL_WRAPPER_TYPES_H_ diff --git a/tools/make_wrapper_types_header.py b/tools/make_wrapper_types_header.py index cfa554429..09c9492f3 100644 --- a/tools/make_wrapper_types_header.py +++ b/tools/make_wrapper_types_header.py @@ -19,6 +19,7 @@ def make_wrapper_types_header(header): for clsname in clsnames: result += ' ' + get_wrapper_type_enum(clsname) + ',\n' + result += '\n WT_LAST\n' result += '};\n\n' + \ '#endif // CEF_LIBCEF_DLL_WRAPPER_TYPES_H_'