Cdbext: Discard old watches when syncing...

... to make sure everything is new evaluated.

Change-Id: I256e044e0095c0c4d2e4563474768ba2fdc3c85e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
David Schulz
2015-03-06 14:09:40 +01:00
parent bc124ff97f
commit 7db238c116

View File

@@ -507,16 +507,16 @@ static std::string commandLocals(ExtensionCommandContext &commandExtCtx,PCSTR ar
// Synchronize watches if desired. // Synchronize watches if desired.
WatchesSymbolGroup *watchesSymbolGroup = extCtx.watchesSymbolGroup(); WatchesSymbolGroup *watchesSymbolGroup = extCtx.watchesSymbolGroup();
if (watchSynchronization) { if (watchSynchronization) {
if (watcherInameExpressionMap.empty()) { // No watches..kill group. watchesSymbolGroup = 0;
watchesSymbolGroup = 0; extCtx.discardWatchesSymbolGroup();
extCtx.discardWatchesSymbolGroup(); if (!watcherInameExpressionMap.empty()) {
if (SymbolGroupValue::verbose)
DebugPrint() << "Discarding watchers";
} else {
// Force group into existence // Force group into existence
watchesSymbolGroup = extCtx.watchesSymbolGroup(commandExtCtx.symbols(), errorMessage); watchesSymbolGroup = extCtx.watchesSymbolGroup(commandExtCtx.symbols(), errorMessage);
if (!watchesSymbolGroup || !watchesSymbolGroup->synchronize(commandExtCtx.symbols(), watcherInameExpressionMap, errorMessage)) if (!watchesSymbolGroup || !watchesSymbolGroup->synchronize(commandExtCtx.symbols(),
watcherInameExpressionMap,
errorMessage)) {
return std::string(); return std::string();
}
} }
} }