Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.4x Bug Tracker: Browse

[#1025] FileSelector SEGV on dynamic callback

Date:
2004-02-24 06:25
Priority:
3
State:
Closed
Submitted by:
Andrew Bettison, Acacia Research (andrewb-acres)
Assigned to:
Willian Padovani Germano (ianwill)
Group:
V 2.31 release
Resolution:
Fixed
Category:
Python
 
Summary:
FileSelector SEGV on dynamic callback
Detailed description
Running the following script provokes causes Blender to
fail with a SIGSEGV:

import Blender.Window

def make_callback(func):
def callback(filename):
print "start callback"
func(filename)
print "end callback"
return callback

def poing(filename):
print "filename =", filename

Blender.Window.FileSelector(make_callback(poing),'Poing')

The problem is caused by
blender/python/api2_2x/Window.c:M_Window_FileSelector()
which fails to Py_INCREF(EXPP_FS_PyCallback) before
returning. If this is added, then the corresponding
Py_DECREF must be done prior to setting
EXPP_FS_PyCallback = NULL, ie in getSelectedFile(), and
also at the top of M_Window_FileSelector(), prior to
calling PyArg_ParseTuple(), to handle the case where
the user canceled the file select hence
getSelectedFile() never got called hence
EXPP_FS_PyCallback is still not NULL.

Followup

No Followups Have Been Posted

 

Attached Files:

No Files Currently Attached

Changes:

Field Old Value Date By
ResolutionInvestigate2004-04-11 06:05ianwill
close_dateNone2004-04-11 06:05ianwill
assigned_tomichel2004-04-11 06:05ianwill
status_idOpen2004-04-11 06:05ianwill
ResolutionNew2004-02-29 17:19michel
assigned_tonone2004-02-29 17:19michel