- opening the file selector was freeing a NULL pointer
authorCampbell Barton <ideasman42@gmail.com>
Tue, 15 Sep 2009 10:52:36 +0000 (10:52 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 15 Sep 2009 10:52:36 +0000 (10:52 +0000)
- some warnings in last commit.

source/blender/editors/space_file/space_file.c
source/blender/python/intern/bpy_rna.c

index 47839ea03421a7a7fa4ad5ca78b2724a996898db..68eeb8718a2424ee19feda5eb42fa25ba31d5bb2 100644 (file)
@@ -156,8 +156,10 @@ static void file_free(SpaceLink *sl)
 static void file_init(struct wmWindowManager *wm, ScrArea *sa)
 {
        SpaceFile *sfile= (SpaceFile*)sa->spacedata.first;
-       MEM_freeN(sfile->params);
-       sfile->params = 0;
+       if(sfile->params) {
+               MEM_freeN(sfile->params);
+               sfile->params = 0;
+       }
        printf("file_init\n");
 }
 
index 820f96f1e817d458c2659d9ec24575af3528479b..c2335bea9953fbb9a4b0c266775d1077f45d90b7 100644 (file)
@@ -1680,6 +1680,7 @@ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self)
 {
        /* Try get values from a collection */
        PyObject *ret;
+       PyObject *iter;
        
        if(RNA_property_array_check(&self->ptr, self->prop)) {
                int len = pyrna_prop_array_length(self);
@@ -1691,7 +1692,7 @@ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self)
                        PyList_SET_ITEM(ret, i, pyrna_prop_to_py_index(self, i));
                }
        }
-       else if (ret = pyrna_prop_values(self)) {
+       else if ((ret = pyrna_prop_values(self))) {
                /* do nothing */
        }
        else {
@@ -1701,7 +1702,7 @@ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self)
        
        
        /* we know this is a list so no need to PyIter_Check */
-       PyObject *iter = PyObject_GetIter(ret);
+       iter = PyObject_GetIter(ret);
        Py_DECREF(ret);
        return iter;
 }