changeset 737:897646df1de1

Handle preloading of resources that do not have rops.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 21 Apr 2013 20:33:48 +0300
parents ea42faa02a9a
children 485bbb2e7deb
files dmres.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dmres.c	Sun Apr 21 20:16:16 2013 +0300
+++ b/dmres.c	Sun Apr 21 20:33:48 2013 +0300
@@ -613,7 +613,8 @@
     int ret = DMERR_OK;
 
     // Check if we want to preload raw data?
-    if (handle->lib->flags & DRF_PRELOAD_RAW)
+    if ((handle->lib->flags & DRF_PRELOAD_RAW) ||
+        handle->rops == NULL || handle->rops->load == NULL)
     {
         if (handle->flags & DMF_LOADED_RAW)
             ret = DMERR_OK;
@@ -699,6 +700,7 @@
         *phandle = handle = NULL;
     }
 
+    dmfreset(handle);
     return res;
 }