Fix T66076: crash deleting imported Alembic object

This commit is contained in:
Brecht Van Lommel 2019-06-24 14:47:46 +02:00
parent d6d36b9892
commit 4f97e33e90
Notes: blender-bot 2023-02-14 05:25:44 +01:00
Referenced by issue #66076, Deleting Imported allembic object crashes blender
1 changed files with 4 additions and 2 deletions

View File

@ -100,7 +100,9 @@ void BKE_cachefile_reader_open(CacheFile *cache_file,
void BKE_cachefile_reader_free(CacheFile *cache_file, struct CacheReader **reader)
{
#ifdef WITH_ALEMBIC
BLI_assert(cache_file->id.tag & LIB_TAG_COPIED_ON_WRITE);
if (cache_file) {
BLI_assert(cache_file->id.tag & LIB_TAG_COPIED_ON_WRITE);
}
if (*reader != NULL) {
CacheReader_free(*reader);
@ -108,7 +110,7 @@ void BKE_cachefile_reader_free(CacheFile *cache_file, struct CacheReader **reade
/* Multiple modifiers and constraints can call this function concurrently. */
BLI_spin_lock(&spin);
if (cache_file->handle_readers) {
if (cache_file && cache_file->handle_readers) {
BLI_gset_remove(cache_file->handle_readers, reader, NULL);
}
BLI_spin_unlock(&spin);