test 2 done

This commit is contained in:
Rémi Heredero 2023-10-17 15:12:51 +02:00
parent c1e65d41ee
commit 4002757765
3 changed files with 3 additions and 5 deletions

View File

@ -2,6 +2,7 @@
#include "xf/timeout.h"
#include "xf/initialevent.h"
#include "xf/behavior.h"
#include "trace/trace.h"
// TODO done: Implement code for XFBehavior class
@ -10,9 +11,6 @@ XFBehavior::XFBehavior() {
}
XFBehavior::~XFBehavior() {
if (this->deleteOnTerminate()) {
delete this;
}
}
void XFBehavior::startBehavior() {

View File

@ -4,7 +4,7 @@
XFCustomEvent::XFCustomEvent(int id, interface::XFBehavior *pBehavior):
XFEvent(XFEventType::Unknown, id){
XFEvent(XFEventType::Event, id){
setBehavior(pBehavior);
}

View File

@ -37,7 +37,7 @@ void XFDispatcher::dispatchEvent(const XFEvent *pEvent) const {
//Trace::out("[DEBUG] - Dispatch Event");
XFBehavior::TerminateBehavior terminateBehavior;
terminateBehavior = pEvent->getBehavior()->process(pEvent);
if(terminateBehavior) {
if(terminateBehavior && pEvent->getBehavior()->deleteOnTerminate()) {
delete pEvent->getBehavior();
if(pEvent->deleteAfterConsume()) {
delete pEvent;