Commits

Lisandro Dalcin committed 6d87326

Fix PetscObjectDestroyOptionsHandlers() to support missing destroy function

  • Participants
  • Parent commits 0f0f11e

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);