Another bugfix.

git-svn-id: https://hyracks.googlecode.com/svn/branches/hyracks_inverted_index_updates_new@1866 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks-storage-am-lsm-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexRangeSearchCursor.java b/hyracks-storage-am-lsm-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexRangeSearchCursor.java
index 995b854..875421b 100644
--- a/hyracks-storage-am-lsm-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexRangeSearchCursor.java
+++ b/hyracks-storage-am-lsm-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexRangeSearchCursor.java
@@ -74,6 +74,7 @@
             throw new HyracksDataException(e);
         }        
         invListCursor.pinPages();
+        unpinNeeded = true;
     }
 
     @Override
@@ -115,6 +116,7 @@
     public void close() throws HyracksDataException {
         if (unpinNeeded) {
             invListCursor.unpinPages();
+            unpinNeeded = false;
         }
         btreeCursor.close();
     }
@@ -123,6 +125,7 @@
     public void reset() throws HyracksDataException {
         if (unpinNeeded) {
             invListCursor.unpinPages();
+            unpinNeeded = false;
         }
         btreeCursor.close();
         open(null, btreePred);