Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikk...@gmail.com> --- src/mesa/main/transformfeedback.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index a737463..72c5c18 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -192,13 +192,17 @@ _mesa_free_transform_feedback(struct gl_context *ctx) NULL); /* Delete all feedback objects */ - _mesa_HashDeleteAll(ctx->TransformFeedback.Objects, delete_cb, ctx); - _mesa_DeleteHashTable(ctx->TransformFeedback.Objects); + if (ctx->TransformFeedback.Objects) { + _mesa_HashDeleteAll(ctx->TransformFeedback.Objects, delete_cb, ctx); + _mesa_DeleteHashTable(ctx->TransformFeedback.Objects); + } /* Delete the default feedback object */ assert(ctx->Driver.DeleteTransformFeedback); - ctx->Driver.DeleteTransformFeedback(ctx, - ctx->TransformFeedback.DefaultObject); + if (ctx->TransformFeedback.DefaultObject) { + ctx->Driver.DeleteTransformFeedback(ctx, + ctx->TransformFeedback.DefaultObject); + } ctx->TransformFeedback.CurrentObject = NULL; } -- 1.8.5.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev