aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken/basewrapper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Decref reference to type objectJohn Ehresman2013-06-241-19/+19
| | | | | | | | A decref is needed if the type is not subclassed when an instance is deallocated Change-Id: I2c64d7cb5b726c5bf108c1cbc5283cf315a5f8e9 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Fix segfault when using shiboken.deleteJohn Ehresman2013-06-241-1/+11
| | | | | | | | When an object is deleted, invalidate / releaseWrapper needs to be called before cptr array is deleted. Change-Id: I82f71f569d5a0f52084fbe1cc3d7846e764c7ef6 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Fix bug introduced when recursive_invalidate was added.John Cummings2013-06-241-5/+14
| | | | | | | | | | If a Python object is passed to recursive_invalidate and is a sequence, each item in the sequence is invalidated Add unit test for recursive invalidate of a sequence Change-Id: I70834f8e027bd17a04c0e443bc7d584d1fde26c1 Reviewed-by: John Ehresman <jpe@wingware.com> Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Prevent infinite recursion in invalidateJohn Ehresman2013-06-131-5/+15
| | | | | Change-Id: I8946a8572b608bf8ede211d270f797f135f8083a Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Replaced Nokia copyrights in headerTeemu Kaukoranta2013-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Replaced old Nokia copyrights with Digia copyrights. Removed "All rights reserved" strings without leading copyrights were removed (for example, 'Copyright SomeCompany, all rights reserved remain untouched). Did NOT touch contact details, will change them later. Excluded folders that have '3rdparty' in path. Used command: find . -path '*/3rdparty/*' -prune -o -exec grep -ilI -E '.*Copyright.*Nokia.*' {} \; | tee >(xargs sed -i -r '1,10 s/([ \t#*]*)(.*Copyright.*Nokia.*)/ \1Copyright \(C\) 2013 Digia Plc and\/or its subsidiary\(-ies\)\./I') >(xargs sed -i -r '1,10 s/(^[ \t#*]*)(all rights reserved.*)/\1/I') This excludes binary files and retains whitespace and #* characters in the beginning of the edited lines. Change-Id: I0d49f991c3dbd45d804843f185714e8681bc6c51 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Janne Anttila <janne.anttila@digia.com>
* Fix possible conflict with garbage collector.Robin Dunn2013-05-131-0/+17
| | | | | | | | | Ensure that the GC is no longer tracking object an object before starting to delete it. Since Shiboken's object deletion goes through several steps we need to ensure that the GC will not try to delete the same object. Change-Id: Ia3337c72204b0ebf524959e1c99fbef7c1a02249 Reviewed-by: John Ehresman <jpe@wingware.com>
* PYSIDE-83 Fix segfault calling shiboken.dumpNathan Smith2012-07-041-9/+14
| | | | | | | | | | shiboken.dump would segfault when called on an object whose C++ object had been deleted or whose parent C++ object had been deleted. This now checks to see if the data pointers beneath the PyObject are NULL before printing data. Change-Id: I89763a3ca3a5d25fad4142ff924692cd232c9c40 Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
* Fix and test case for bug PYSIDE-72.Nathan Smith2012-07-041-1/+1
| | | | | | | | | | | | | | | | The address of the PyObject is used directly as the hash rather than a member of that object. This avoids segfaults when the C++ object has been deleted, rendering the child pointers NULL. Removed a test case verifying that hash(QObject()) != hash(QObject()) because they in fact can be equal. The first QObject dies and is reaped before the second QObject is created, meaning that the second QObject may be allocated at the same address as the first QObject, giving them both the same address. If a reference is held to the first object, though, then they will get different hash values. Change-Id: I116463f88b837726a98720bae36770d53b13f4ee Reviewed-by: Marcelo Lira <marcelo.lira@openbossa.org>
* Set a default hash function for all ObjectTypes.Hugo Parente Lima2012-05-031-0/+6
| | | | | | | | Fix bug PYSIDE-42 Change-Id: I1392374dcf0055309152082e674cc1e3e6472d4d Reviewed-by: Paulo Alcantara <paulo.alcantara@openbossa.org> Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
* Don't clear weakrefs if Python interpreter isn't runningJason McCampbell (Enthought, Inc)2012-04-191-2/+7
| | | | | Change-Id: I51ba2fcf5f881abb38e9b69b115fb98c536e2146 Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
* Merge GeneratorRunner inside Shiboken.Hugo Parente Lima2012-03-091-2/+1
| | | | | | | | | | | | | | | | Conflicts: CMakeLists.txt data/CMakeLists.txt doc/CMakeLists.txt doc/_templates/index.html doc/_templates/layout.html doc/_themes/pysidedocs/static/pysidedocs.css doc/commandlineoptions.rst doc/conf.py.in doc/contents.rst doc/images/bindinggen-development.png doc/images/boostqtarch.png tests/CMakeLists.txt
* Added functions to the new converters API to check if a type is value or object.Marcelo Lira2012-03-081-1/+1
| | | | Comes with unit tests.
* Register type converters by name.Marcelo Lira2012-03-081-5/+5
| | | | This way they can be queried as the soon-to-be-deprecated TypeResolvers.
* Added SBK_CONVERTER, a macro to get the type converter whatever the type, ↵Hugo Parente Lima2012-03-081-6/+0
| | | | but primitive types.
* New converters for C++ primitive types.Marcelo Lira2012-03-081-0/+2
|
* Implemented new type converters, but only for wrapper types.Marcelo Lira2012-03-081-26/+16
|
* Implemented PSEP 0106.Hugo Parente Lima2012-03-081-3/+98
| | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Paulo Alcantra <pcacjr@gmail.com>
* Don't delete parentInfo when it seens to be useless to avoid crash on ↵Hugo Parente Lima2012-03-081-13/+5
| | | | garbage collector.
* Fixed object destruction.Renato Filho2012-03-081-1/+2
|
* Use PyVarObject_HEAD_INIT instead of PyObject_HEAD_INIT.Hugo Parente Lima2012-03-081-4/+2
|
* Using Py_TYPE macro instead of direct access to ob_type to work with Python ↵Hugo Parente Lima2012-03-081-14/+18
| | | | | | 2.x and 3.x. Enclosing PyCObject uses inside #ifdefs
* Fixed invalidate function in objects with refereces to other objects.Renato Filho2012-03-081-0/+29
| | | | | Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
* Revert "Implements PSEP-0106 and fixes bug 902 - "Expose Shiboken ↵Hugo Parente Lima2012-03-081-93/+3
| | | | | | | | functionality through a Python module"." This reverts commit bc8448d7fb91733ff08c2a6a3a878702c14a24e0. The PSEP didn't reach the final version yet, so this commit can't be released.
* Fix bug 995 - "QDeclarativeView.itemAt returns faulty reference. (leading to ↵Hugo Parente Lima2012-03-081-3/+10
| | | | SEGFAULT)"
* Fixed cyclic dependency resolution.Renato Filho2012-03-081-16/+53
| | | | | Reviewer: Hugo Parente <hugo.lima@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Implements PSEP-0106 and fixes bug 902 - "Expose Shiboken functionality ↵Hugo Parente Lima2012-03-081-3/+93
| | | | through a Python module".
* Check for NULL pointer on transferOwnership function.Renato Filho2012-03-081-1/+2
| | | | | | | fixes bug #965. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Neto <lauro.neto@openbossa.org>
* Added a function to initialize a new wrapper type and add it to a module or ↵Marcelo Lira2012-03-081-2/+32
| | | | | | | | | | enclosing class. The class register writer was updated to use the new ObjectType::introduceWrapperType(). Types are now created and registered via the introduceWrapperType() function. I also did a little refactoring on CppGenerator::writeClassRegister.
* Introduces new API to create and import Python modules.Marcelo Lira2012-03-081-0/+4
| | | | | | | | | | | | | The Shiboken::Module namespace also provides management of module types, including the communication of types among dependent modules. Module::create() will call Shiboken::init(), so this can be removed from the generated module's source code. This deprecates the old Shiboken::importModule() function. The generation of module initialization code was updated to use the new Shiboken::Module functions.
* Fix bug 939 - "Shiboken::importModule must verify if PyImport_ImportModule ↵Hugo Parente Lima2012-03-081-2/+5
| | | | | | | succeeds" Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
* Improved documentation on ObjectType's cast related functions.Marcelo Lira2012-03-081-6/+6
|
* Cleared cptr data during the cpp object destruction.Renato Filho2012-03-081-7/+15
| | | | | | This avoid problems when the same addres was used late in the program. Fixes bug #904.
* Fix refleak during the parent c++ object destruction.Renato Filho2012-03-081-1/+13
| | | | | | | Fixes bug #893. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Renato Araújo <renato.filho@openbossa.org>
* Fix object wrapper deletion.Renato Filho2012-03-081-8/+9
| | | | | | | Fixes bug #356. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Renato Araújo <renato.filho@openbossa.org>
* Dealloc Python object before calling the C++ destructor.Hugo Parente Lima2012-03-081-10/+29
| | | | | | | | | | | This will avoid the problem of having Python objects with ref count zero on binding manager while Python code using these objects can be triggered by the C++ object destruction. This commit makes DestroyListenner class unused in whole PySide project, probably it will be marked as deprecated in futher commits. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Renato Araújo <renato.filho@openbossa.org>
* optimized keepreference function.Renato Filho2012-03-081-16/+26
| | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Created the function 'removeReference', used to remove a specificRenato Filho2012-03-081-0/+16
| | | | | | | reference from other object. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Generate code using the new pyside class DestroyListener.Renato Filho2012-03-081-2/+2
| | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
* Removed unused variables/functions.Hugo Parente Lima2012-03-081-12/+0
| | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Defined Shiboken.ObjectType tp_setattro to PyObject_GenericSetAttr.Marcelo Lira2012-03-081-1/+1
| | | | | | | | This fixes bug 634. http://bugs.pyside.org/show_bug.cgi?id=634 Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Fixed keep reference funcion.Renato Filho2012-03-081-6/+8
| | | | | | | | | | The keepReference function does not increase the referece of all objects if the argument is a list. Fixes bug #854. Reviewer: Hugo Parente <hugo.lima@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Improved garbage collector handling of Shiboken types.Marcelo Lira2012-03-081-8/+27
|
* Improved the SbkDbg to avoid throwing exceptions when showing an object.Marcelo Lira2012-03-081-1/+10
| | | | | | | Also added a new Shiboken::Object::isValid signature to help. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Moura <lauro.neto@openbossa.org>
* Remove GCC 4.6 warning on basewrapper.cpp and shibokengenerator.cppHugo Parente Lima2012-03-081-2/+2
| | | | | libshiboken/basewrapper.cpp:212:57: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] generator/shibokengenerator.cpp:1118:9: warning: variable ‘numArgs’ set but not used [-Wunused-but-set-variable]
* Check for old-style bases before calling tp_newsb-1.0.1Lauro Neto2012-03-081-10/+22
| | | | | | | | | | | | | Instead of creating the type instance and them checking for old-style base classes, check for them in the beginning. The later check was causing the new type object to "leak" and failing an assert in the garbage collector. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Reviewer: Hugo Lima <hugo.lima@openbossa.org>
* Do nothing when trying to make an valid object valid twice.Hugo Parente Lima2012-03-081-1/+1
|
* Updated module reload test.Renato Filho2012-03-081-3/+8
| | | | | | | | | Avoid to load a module twice. Fixes bug #734. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Fixed parentInfo cleanup.Renato Filho2012-03-081-3/+6
| | | | | | | Fixes bug #735. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Fix bug 693 - "Heap corruption or double free reported on program exit"Hugo Parente Lima2012-03-081-1/+2
| | | | | Reviewer: Renato Araújo <renato.filho@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Check for class initialization on function Object.isValid.Renato Filho2012-03-081-16/+43
| | | | | | | Fix bug #696. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>