diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-09-13 17:43:16 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:14 -0300 |
commit | c686942f6efbac4ac43cf859bfdd2c7209b783ea (patch) | |
tree | 39254222aca7f5bac8409a0078eaf5bbca2d1cf8 /libshiboken/basewrapper.cpp | |
parent | 987010cb2c5740bf1cb7af54b2c6dc3142c44805 (diff) |
Fix bug 995 - "QDeclarativeView.itemAt returns faulty reference. (leading to SEGFAULT)"
Diffstat (limited to 'libshiboken/basewrapper.cpp')
-rw-r--r-- | libshiboken/basewrapper.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp index 006b9c62a..8ccf89a6b 100644 --- a/libshiboken/basewrapper.cpp +++ b/libshiboken/basewrapper.cpp @@ -646,14 +646,21 @@ const char* getOriginalName(SbkObjectType* self) return self->d->original_name; } -void setTypeDiscoveryFunction(SbkObjectType* self, TypeDiscoveryFunc func) +void setTypeDiscoveryFunctionV2(SbkObjectType* self, TypeDiscoveryFuncV2 func) { self->d->type_discovery = func; } +void setTypeDiscoveryFunction(SbkObjectType* self, TypeDiscoveryFunc func) +{ + self->d->type_discovery = (TypeDiscoveryFuncV2)func; +} + TypeDiscoveryFunc getTypeDiscoveryFunction(SbkObjectType* self) { - return self->d->type_discovery; + // This is an illegal cast because the return value is different, + // but nobody ever used this function, so... =] + return (TypeDiscoveryFunc)self->d->type_discovery; } void copyMultimpleheritance(SbkObjectType* self, SbkObjectType* other) @@ -1017,7 +1024,7 @@ PyObject* newObject(SbkObjectType* instanceType, instanceType = reinterpret_cast<SbkObjectType*>(tr->pythonType()); } if (!tr) - instanceType = BindingManager::instance().resolveType(cptr, instanceType); + instanceType = BindingManager::instance().resolveType(&cptr, instanceType); } SbkObject* self = reinterpret_cast<SbkObject*>(SbkObjectTpNew(reinterpret_cast<PyTypeObject*>(instanceType), 0, 0)); |