Page MenuHome

Fix T71712: Free the dynamic mesh preview when rebuilding the PBVH
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Dec 24 2019, 12:44 AM.

Details

Summary

The PBVH usually is rebuild after a topology change, so it does not make
sense to keep the previous dynamic mesh preview vertex list. This may
cause a crash is the number of vertices of the new mesh (and preview) is
larger previous one. Now the list is deleted with the PBVH and a new one
will be generated using the new mesh when the cursor is updated.

Diff Detail

Repository
rB Blender

Event Timeline

Jeroen Bakker (jbakker) requested changes to this revision.Jan 7 2020, 3:46 PM

Code was good, but better to use MEM_SAFE_FREE for these cases

source/blender/blenkernel/intern/paint.c
1026
MEM_SAFE_FREE(ss->preview_vert_index_list)
ss->preview_vert_index_count = 0;

Same thing can also be done for the other parts of this function.

a bit shorter

This revision now requires changes to proceed.Jan 7 2020, 3:46 PM

We could remove the empty lines here for readability, but fix is fine.

This revision is now accepted and ready to land.Jan 14 2020, 8:30 AM