-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
When we call this function
void postNotification(Notification* pNf)
if the _pOwner is null you will end up in a memory leak because you usually call the method like
postNotification(new Poco::TaskCustomNotification<some_class>(
and moreover if you try to do this
Poco::TaskCustomNotification<some_class>::Ptr cNF = new Poco::TaskCustomNotification<some_class>(this);
postNotification(cNF );
you will endup with a double delete, because the _pOwner->postNotification(pNf); inside take ownership regardless if you have the ::Ptr outside.
Probably the postNotification(Notification* pNf) should be changed in postNotification(Notification::Ptr pNf)
Reactions are currently unavailable