Project

General

Profile

Support #7710

Continuations and WResource lifespan

Added by Velvet Jones about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
09/09/2020
Due date:
% Done:

0%

Estimated time:

Description

Is the pseudo-code below acceptable concerning the lifespan of the WFileResource member in the event that the WFileResource uses continuations? Specifically wondering what happens here when I return from handleRequest.

class MyClass : public Wt::WResource

{

void handleRequest(request,response)

{

m_fr.setFileName(blah);

m_fr.setMimeType(blah)

m_fr.handleRequest(request,response);

return;

}

Wt::WFileResource m_fr;

}

#1

Updated by Roel Standaert about 1 month ago

The beingDeleted() which is called in the destructor of a resource will cancel all remaining continuations. Any continuation will be aborted.

Also available in: Atom PDF