From 5af9e5fda96bbf47ebf6bb5cfdd6b67bcbb365cb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 12 Feb 2011 09:09:52 +0000 Subject: [PATCH] - resource leak in pointcache, opendir without closedir() - reading pointcache was using an incorrect, always NULL variable. - commented NDof code, was giving warnings and isnt used now. --- source/blender/blenkernel/intern/pointcache.c | 1 + source/blender/blenloader/intern/readfile.c | 5 ++--- source/blender/editors/space_view3d/view3d_edit.c | 2 ++ source/blender/imbuf/IMB_thumbs.h | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index bd919d2166d..84331e1b318 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2863,6 +2863,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, char *from, char *to) } } } + closedir(dir); strcpy(pid->cache->name, old_name); } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index dfd586fdb9a..6f22b1ad6f2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2981,9 +2981,8 @@ static void direct_link_pointcache(FileData *fd, PointCache *cache) static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointCache **ocache, int force_disk) { - PointCache *cache= NULL; - if(ptcaches->first) { + PointCache *cache= NULL; link_list(fd, ptcaches); for(cache=ptcaches->first; cache; cache=cache->next) { direct_link_pointcache(fd, cache); @@ -3001,7 +3000,7 @@ static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointC direct_link_pointcache(fd, *ocache); if(force_disk) { (*ocache)->flag |= PTCACHE_DISK_CACHE; - cache->step = 1; + (*ocache)->step = 1; } ptcaches->first = ptcaches->last = *ocache; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index bc9c41f3add..de0878925ae 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2799,6 +2799,7 @@ void filterNDOFvalues(float *sbval) sbval[i]=0.0; } +#if 0 // statics for controlling rv3d->dist corrections. // viewmoveNDOF zeros and adjusts rv3d->ofs. // viewmove restores based on dz_flag state. @@ -3139,6 +3140,7 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int UNUSED(mode)) */ // XXX scrarea_do_windraw(curarea); } +#endif // if 0, unused NDof code /* give a 4x4 matrix from a perspective view, only needs viewquat, ofs and dist * basically the same as... diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h index cae6edaefee..02f8e1567bf 100644 --- a/source/blender/imbuf/IMB_thumbs.h +++ b/source/blender/imbuf/IMB_thumbs.h @@ -75,6 +75,9 @@ void IMB_thumb_makedirs(void); ImBuf *IMB_loadblend_thumb(const char *path); void IMB_overlayblend_thumb(unsigned int *thumb, int width, int height, float aspect); +#ifdef __cplusplus +} +#endif /* __cplusplus */ #endif /* _IMB_THUMBS_H */