populate post capture model when page is current and clear it when we leave
[harmattan/cameraplus] / lib / qtcamanalysisbin.cpp
index 5c093a8..332e2b1 100644 (file)
@@ -1,7 +1,7 @@
 /*!
  * This file is part of CameraPlus.
  *
- * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -134,6 +134,12 @@ QtCamAnalysisBinPrivate *qt_cam_analysis_bin_create(const QStringList& factories
     added << element;
   }
 
+  if (added.isEmpty()) {
+    gst_object_unref (bin);
+
+    return 0;
+  }
+
   if (added.size() > 1) {
     for (int x = 1; x < added.count(); x++) {
       GstElement *elem = added[x];