diff options
Diffstat (limited to 'src/main/java/com/amazon/carbonado/layout')
-rw-r--r-- | src/main/java/com/amazon/carbonado/layout/Layout.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/com/amazon/carbonado/layout/Layout.java b/src/main/java/com/amazon/carbonado/layout/Layout.java index 62e29f2..1c6b63d 100644 --- a/src/main/java/com/amazon/carbonado/layout/Layout.java +++ b/src/main/java/com/amazon/carbonado/layout/Layout.java @@ -231,13 +231,17 @@ public class Layout { .orderBy("ordinal")
.fetch();
- List<LayoutProperty> list = new ArrayList<LayoutProperty>();
+ try {
+ List<LayoutProperty> list = new ArrayList<LayoutProperty>();
- while (cursor.hasNext()) {
- list.add(new LayoutProperty(cursor.next()));
- }
+ while (cursor.hasNext()) {
+ list.add(new LayoutProperty(cursor.next()));
+ }
- mAllProperties = Collections.unmodifiableList(list);
+ mAllProperties = Collections.unmodifiableList(list);
+ } finally {
+ cursor.close();
+ }
}
return mAllProperties;
|