Commits

Jed Brown  committed 7ea2a77 Merge

Merge branch 'dalcinl/opthandlers-destroy'

* dalcinl/opthandlers-destroy:
Fix PetscObjectDestroyOptionsHandlers() to support missing destroy function

  • Participants
  • Parent commits ec79c41, 6d87326

Comments (0)

Files changed (1)

File src/sys/objects/inherit.c

   PetscFunctionBegin;
   PetscValidHeader(obj,1);
   for (i=0; i<obj->noptionhandler; i++) {
-    ierr = (*obj->optiondestroy[i])(obj,obj->optionctx[i]);CHKERRQ(ierr);
+    if (obj->optiondestroy[i]) {
+      ierr = (*obj->optiondestroy[i])(obj,obj->optionctx[i]);CHKERRQ(ierr);
+    }
   }
   obj->noptionhandler = 0;
   PetscFunctionReturn(0);