Skip to content

Commit b52df71

Browse files
authored
Factories no longer default to no_weak_ref (#913)
1 parent 464e591 commit b52df71

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

strings/base_implements.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,6 @@ namespace winrt::impl
10411041
return Windows::Foundation::TrustLevel::BaseTrust;
10421042
}
10431043

1044-
using is_factory = std::disjunction<std::is_same<Windows::Foundation::IActivationFactory, I>...>;
1045-
10461044
private:
10471045

10481046
class has_final_release
@@ -1057,7 +1055,7 @@ namespace winrt::impl
10571055

10581056
using is_agile = std::negation<std::disjunction<std::is_same<non_agile, I>...>>;
10591057
using is_inspectable = std::disjunction<std::is_base_of<Windows::Foundation::IInspectable, I>...>;
1060-
using is_weak_ref_source = std::conjunction<is_inspectable, std::negation<is_factory>, std::negation<std::disjunction<std::is_same<no_weak_ref, I>...>>>;
1058+
using is_weak_ref_source = std::conjunction<is_inspectable, std::negation<std::disjunction<std::is_same<no_weak_ref, I>...>>>;
10611059
using use_module_lock = std::negation<std::disjunction<std::is_same<no_module_lock, I>...>>;
10621060
using weak_ref_t = impl::weak_ref<is_agile::value, use_module_lock::value>;
10631061

@@ -1333,7 +1331,6 @@ WINRT_EXPORT namespace winrt
13331331

13341332
using base_type = typename impl::base_implements<D, I...>::type;
13351333
using root_implements_type = typename base_type::root_implements_type;
1336-
using is_factory = typename root_implements_type::is_factory;
13371334

13381335
using base_type::base_type;
13391336

test/old_tests/UnitTests/weak.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ TEST_CASE("weak,QI")
150150
{
151151
IActivationFactory object = make<Factory>();
152152
REQUIRE(object.try_as<Windows::Foundation::IInspectable>());
153-
REQUIRE(!object.try_as<winrt::impl::IWeakReferenceSource>());
153+
REQUIRE(object.try_as<winrt::impl::IWeakReferenceSource>());
154154
}
155155

156156
SECTION("no_weak_ref")

0 commit comments

Comments
 (0)