现象:
在函数里面获取到cl,可以正常使用;
从函数中返回cl,再使用该cl时出现Segmentation fault
-----------------------------------------------------------------------
testbug.py文件内容如下:
import pysequoiadb
from pysequoiadb import client
from pysequoiadb import const
from pysequoiadb.error import SDBBaseError
def f1():
db = client()
cl = db.get_collection('mycs.mycl')
print cl.get_count()
return cl
cl = f1()
cl.get_count()
-----------------------------------------------------------------------
数据库中,集合mycs.mycl这里面有一条数据
执行结果如下:
-bash-4.2$ python testbug.py
1
Segmentation fault