Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int gp_widget_free ( CameraWidget widget  ) 

Frees a CameraWidget.

Parameters:
widget the CameraWidget to be freed
Returns:
a gphoto2 error code.

Definition at line 135 of file gphoto2-widget.c.

References CHECK_NULL, _CameraWidget::children, _CameraWidget::choice, _CameraWidget::choice_count, GP_OK, gp_widget_count_children(), gp_widget_free(), GP_WIDGET_SECTION, GP_WIDGET_WINDOW, _CameraWidget::type, and _CameraWidget::value_string.

Referenced by gp_widget_free(), and gp_widget_unref().

{
      int x;
      CHECK_NULL (widget);

      /* Free children recursively */
      if ((widget->type == GP_WIDGET_WINDOW) ||
          (widget->type == GP_WIDGET_SECTION)) {
            for (x = 0; x < gp_widget_count_children (widget); x++)
                  gp_widget_free (widget->children[x]);
            free (widget->children);
      }
      for (x = 0; x < widget->choice_count; x++)
            free (widget->choice[x]);
      free (widget->choice);

        if (widget->value_string)
            free (widget->value_string);
      free (widget);
      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index