Fix deadlock, I hope

This commit is contained in:
rdb 2009-05-18 05:49:49 +00:00
parent 5809061ac9
commit 5fc21e0779

View File

@ -328,7 +328,7 @@ do_read_one(const Filename &fullpath, const Filename &alpha_fullpath,
} }
nassertr(n == 0, false); nassertr(n == 0, false);
nassertr(z >= 0 && z < get_z_size(), false); nassertr(z >= 0 && z < _z_size, false);
VideoPage &page = modify_page(z); VideoPage &page = modify_page(z);
if (!page._color.read(fullpath)) { if (!page._color.read(fullpath)) {
@ -349,13 +349,14 @@ do_read_one(const Filename &fullpath, const Filename &alpha_fullpath,
if (!has_name()) { if (!has_name()) {
set_name(fullpath.get_basename_wo_extension()); set_name(fullpath.get_basename_wo_extension());
} }
if (!has_filename()) { // Don't use has_filename() here, it will cause a deadlock
set_filename(fullpath); if (_filename.empty()) {
set_alpha_filename(alpha_fullpath); _filename = fullpath;
_alpha_filename = alpha_fullpath;
} }
set_fullpath(fullpath); _fullpath = fullpath;
set_alpha_fullpath(alpha_fullpath); _alpha_fullpath = alpha_fullpath;
} }
_primary_file_num_channels = 3; _primary_file_num_channels = 3;