Skip to content

Aws::Crt::ApiHandle destructor hanging #454

Answered by jmklix
stwirth asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like your using part of SampleConnectAndDisconnect, but you seem to be missing the wait for disconnect:

        /*
         * Invoked when a disconnect message has completed.
         */
        auto onDisconnect = [&](Aws::Crt::Mqtt::MqttConnection &) {
            fprintf(stdout, "Disconnect completed\n");
            connectionClosedPromise.set_value();
        };
        
        ...

        /* Disconnect */
        if (connection->Disconnect())
        {
            connectionClosedPromise.get_future().wait();
        }

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@stwirth
Comment options

@stwirth
Comment options

@jmklix
Comment options

Answer selected by stwirth
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants