Changeset 45874 in vbox for trunk/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp
- Timestamp:
- May 2, 2013 12:16:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp
r44529 r45874 217 217 { 218 218 AssertPtrReturn(pCache, VERR_INVALID_POINTER); 219 AssertPtrReturn(pszName, VERR_INVALID_POINTER); 220 219 221 Assert(pCache->uClientID); 220 AssertPtrReturn(pszName, VERR_INVALID_POINTER);221 222 222 223 /* … … 261 262 /* Write the update. */ 262 263 rc = vboxServicePropCacheWritePropF(pCache->uClientID, pNode->pszName, pNode->fFlags, pszValue); 263 VBoxServiceVerbose(4, " PropCache %p: Written \"%s\"=\"%s\" (flags: %x), rc=%Rrc\n",264 VBoxServiceVerbose(4, "[PropCache %p]: Written \"%s\"=\"%s\" (flags: %x), rc=%Rrc\n", 264 265 pCache, pNode->pszName, pszValue, pNode->fFlags, rc); 265 RTStrFree(pNode->pszValue); 266 pNode->pszValue = RTStrDup(pszValue); 267 if (!pNode->pszValue) 268 rc = VERR_NO_MEMORY; 266 if (RT_SUCCESS(rc)) /* Only update the node's value on successful write. */ 267 { 268 RTStrFree(pNode->pszValue); 269 pNode->pszValue = RTStrDup(pszValue); 270 if (!pNode->pszValue) 271 rc = VERR_NO_MEMORY; 272 } 269 273 } 270 274 else … … 276 280 if (pNode->pszValue) /* Did we have a value before? Then the value needs to be deleted. */ 277 281 { 278 /* Delete property (but do not remove from cache) if not deleted yet. */279 RTStrFree(pNode->pszValue);280 pNode->pszValue = NULL;281 282 rc = vboxServicePropCacheWritePropF(pCache->uClientID, pNode->pszName, 282 283 0, /* Flags */ NULL /* Value */); 283 VBoxServiceVerbose(4, " PropCache %p: Deleted \"%s\"=\"%s\" (flags: %x), rc=%Rrc\n",284 VBoxServiceVerbose(4, "[PropCache %p]: Deleted \"%s\"=\"%s\" (flags: %x), rc=%Rrc\n", 284 285 pCache, pNode->pszName, pNode->pszValue, pNode->fFlags, rc); 286 if (RT_SUCCESS(rc)) /* Only delete property value on successful Vbgl deletion. */ 287 { 288 /* Delete property (but do not remove from cache) if not deleted yet. */ 289 RTStrFree(pNode->pszValue); 290 pNode->pszValue = NULL; 291 } 285 292 } 286 293 else … … 291 298 RTCritSectLeave(&pCache->CritSect); 292 299 } 300 301 VBoxServiceVerbose(4, "[PropCache %p]: Updating \"%s\" resulted in rc=%Rrc\n", 302 pCache, pszName, rc); 293 303 294 304 /* Delete temp stuff. */
Note:
See TracChangeset
for help on using the changeset viewer.