Index: /branches/eam_branches/ipp-20101103/psModules/src/camera/pmFPAfileIO.c
===================================================================
--- /branches/eam_branches/ipp-20101103/psModules/src/camera/pmFPAfileIO.c	(revision 29911)
+++ /branches/eam_branches/ipp-20101103/psModules/src/camera/pmFPAfileIO.c	(revision 29912)
@@ -135,7 +135,4 @@
     PS_ASSERT_PTR_NON_NULL(view, false);
 
-    // an internal file should not be sent here (should not be left on config->files)
-    PS_ASSERT(file->mode != PM_FPA_MODE_INTERNAL, false);
-
     // skip the following states
     if (file->state & PM_FPA_STATE_INACTIVE) {
@@ -143,4 +140,8 @@
         return true;
     }
+
+    // an active internal file should not be sent here (should not be left on config->files)
+    PS_ASSERT(file->mode != PM_FPA_MODE_INTERNAL, false);
+
     if (file->mode != PM_FPA_MODE_READ) {
         psTrace("psModules.camera", 6, "skip read for %s, mode is not READ", file->name);
@@ -258,11 +259,12 @@
         return true;
     }
+
+    // an active internal file should not be returned to here
+    PS_ASSERT(file->mode != PM_FPA_MODE_INTERNAL, false);
+
     if (file->mode != PM_FPA_MODE_WRITE) {
         psTrace("psModules.camera", 6, "skip create for non-write file %s", file->name);
         return true;
     }
-
-    // an internal file should not be returned to here
-    PS_ASSERT(file->mode != PM_FPA_MODE_INTERNAL, false);
 
     // get the current level
@@ -335,13 +337,10 @@
     }
 
+    // an ACTIVE internal file should not be sent here
+    PS_ASSERT(file->mode != PM_FPA_MODE_INTERNAL, false);
+
     if (file->mode != PM_FPA_MODE_WRITE) {
         psTrace("psModules.camera", 6, "skip write for %s, mode is not WRITE", file->name);
         return true;
-    }
-
-    // an internal file should not be returned to here
-    if (file->mode == PM_FPA_MODE_INTERNAL) {
-        psError(PS_ERR_IO, true, "File is mode PM_FPA_MODE_INTERNAL");
-        return false;
     }
 
@@ -523,7 +522,4 @@
     PS_ASSERT_PTR_NON_NULL(view, false);
 
-    // an internal file should not be sent here (should not be left on config->files)
-    PS_ASSERT(file->mode != PM_FPA_MODE_INTERNAL, false);
-
     // skip the following states
     if (file->state & PM_FPA_STATE_INACTIVE) {
@@ -531,8 +527,12 @@
         return true;
     }
+
     if (file->state == PM_FPA_STATE_CLOSED) {
         psTrace("psModules.camera", 6, "skip close for %s, files is closed", file->name);
         return true;
     }
+
+    // an active internal file should not be sent here (should not be left on config->files)
+    PS_ASSERT(file->mode != PM_FPA_MODE_INTERNAL, false);
 
     // is current level == open level?
@@ -596,11 +596,11 @@
     PS_ASSERT_PTR_NON_NULL(view, false);
 
-    // an internal file should not be sent here (should not be left on config->files)
-    PS_ASSERT(file->mode != PM_FPA_MODE_INTERNAL, false);
-
     if (file->state & PM_FPA_STATE_INACTIVE) {
         psTrace("psModules.camera", 6, "skip free for %s, files is inactive", file->name);
         return true;
     }
+
+    // an active internal file should not be sent here (should not be left on config->files)
+    PS_ASSERT(file->mode != PM_FPA_MODE_INTERNAL, false);
 
     // get the current level
@@ -746,5 +746,5 @@
     }
 
-    // these are programming errors
+    // an ACTIVE internal file should not be sent here
     PS_ASSERT(file->mode != PM_FPA_MODE_NONE, false);
     PS_ASSERT(file->mode != PM_FPA_MODE_INTERNAL, false);
