Skip to content

Commit 1af12ee

Browse files
committed
Fix a dangling reference in Schema::getTypes
1 parent df763b0 commit 1af12ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Introspection.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ void Schema::AddDirective(std::shared_ptr<object::__Directive> directive)
5151

5252
std::future<std::vector<std::shared_ptr<object::__Type>>> Schema::getTypes(const std::shared_ptr<service::RequestState>&) const
5353
{
54+
auto keepAlive = shared_from_this();
55+
5456
return std::async(std::launch::deferred,
55-
[this]()
57+
[this, keepAlive]()
5658
{
5759
std::vector<std::shared_ptr<object::__Type>> result(_types.size());
5860

0 commit comments

Comments
 (0)