[blam] ItemStore: Allow removing by id



commit 8a4ab66eaba8531ae6583908fa4133b993c49cc3
Author: Carlos Martín Nieto <carlos cmartin tk>
Date:   Tue Mar 1 13:06:55 2011 +0100

    ItemStore: Allow removing by id
    
    Signed-off-by: Carlos Martín Nieto <carlos cmartin tk>

 src/ItemStore.cs |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/ItemStore.cs b/src/ItemStore.cs
index e917f3f..766438c 100644
--- a/src/ItemStore.cs
+++ b/src/ItemStore.cs
@@ -36,12 +36,21 @@ namespace Imendio.Blam
 
         public void Remove(Item item)
         {
+            if(item == null){
+                return;
+            }
+
             item.Release();
             if(item.RefCount == 0){
                 items.Remove(item.Id);
             }
         }
 
+        public void Remove(string id)
+        {
+            Remove(items[id] as Item);
+        }
+
         public static ItemStore GetInstance()
         {
             if(instance == null){



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]