Changeset 14566


Ignore:
Timestamp:
11/05/12 18:43:46 (12 years ago)
Author:
tbretz
Message:
Do not return anything in JsGetEvent before an event was received
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/RemoteControl.h

    r14559 r14566  
    262262
    263263        const auto it = fInfo.find(service);
     264
     265        // No subscription for this event available
    264266        if (it==fInfo.end())
    265267            return make_pair(0, static_cast<EventImp*>(NULL));
    266268
    267269        EventInfo &info = it->second;
    268         return make_pair(info.counter, (EventImp*)&info.data);
     270
     271        // No event was received yet
     272        if (info.counter==0)
     273            return make_pair(0, static_cast<EventImp*>(NULL));
     274
     275        return make_pair(info.counter-1, (EventImp*)&info.data);
    269276    }
    270277
     
    285292        EventInfo &info = it->second;
    286293
    287         const uint64_t cnt = info.counter++;
     294        const uint64_t cnt = ++info.counter;
    288295        info.data = static_cast<Event>(evt);
    289296
Note: See TracChangeset for help on using the changeset viewer.