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,18 +507,18 @@ 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 (SymbolGroupValue::verbose) if (!watcherInameExpressionMap.empty()) {
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();
} }
} }
}
// Pre-expand. // Pre-expand.
if (!expandedInames.empty()) { if (!expandedInames.empty()) {