Skip to content

ActiveDispatcher saves reference to event context after event was performed until it gets new event #1002

@voron86

Description

@voron86

ActiveDispatcher saves reference to event context after event was performed until it gets new event. So if I pass smart pointer as argument of ActiveMethod with ActiveDispatcher. I can't remove object until I call any ActiveMethod for the same ActiveDispatcher.

I fixed it in my local build:

void ActiveDispatcher::run()
{
AutoPtr pNf = _queue.waitDequeueNotification();
while (pNf && !dynamic_cast<StopNotification*>(pNf.get()))
{
{
MethodNotification* pMethodNf = dynamic_cast<MethodNotification*>(pNf.get());
poco_check_ptr (pMethodNf);
ActiveRunnableBase::Ptr pRunnable = pMethodNf->runnable();
pRunnable->duplicate(); // run will release
pRunnable->run();
pNf = nullptr;
}

    pNf = _queue.waitDequeueNotification();
}

}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions