ClienTest: Fix a resource leak
The wrapped transport agent instance was not reset
This commit is contained in:
parent
8424d22b14
commit
49cf52ed25
|
@ -2845,7 +2845,6 @@ void SyncTests::doInterruptResume(int changes,
|
|||
// by overloading the delete operator.
|
||||
int wasInterrupted;
|
||||
{
|
||||
wrapper->reset();
|
||||
wrapper->setInterruptAtMessage(interruptAtMessage);
|
||||
accessClientB->doSync("changesFromB",
|
||||
SyncOptions(SYNC_TWO_WAY,
|
||||
|
@ -2853,6 +2852,7 @@ void SyncTests::doInterruptResume(int changes,
|
|||
-1, -1, false)).setTransportAgent(wrapper));
|
||||
wasInterrupted = interruptAtMessage != -1 &&
|
||||
wrapper->getMessageCount() <= interruptAtMessage;
|
||||
wrapper->rewind();
|
||||
}
|
||||
|
||||
if (interruptAtMessage != -1) {
|
||||
|
|
|
@ -746,11 +746,12 @@ public:
|
|||
virtual void cancel() { m_wrappedAgent->cancel(); }
|
||||
virtual void shutdown() { m_wrappedAgent->shutdown(); }
|
||||
|
||||
virtual void reset() {
|
||||
virtual void rewind() {
|
||||
m_messageCount = 0;
|
||||
m_interruptAtMessage = -1;
|
||||
m_status = INACTIVE;
|
||||
m_options = NULL;
|
||||
m_wrappedAgent.reset();
|
||||
}
|
||||
virtual Status wait(bool noReply = false) { return m_status; }
|
||||
virtual void setCallback (TransportCallback cb, void *udata, int interval)
|
||||
|
|
Loading…
Reference in New Issue