From c794d08597e6f0c0b54cd70438f3374ccff43201 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 23 Aug 2011 19:29:10 +0000 Subject: [PATCH] Fix %newobject when used in conjunction with %feature(ref). The code from the ref feature was not always being generated for the function specified by %newobject. Documentation for ref and unref moved from Python to the C++ chapter. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12783 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 5 + Doc/Manual/Customization.html | 5 + Doc/Manual/Python.html | 144 +-------------- Doc/Manual/SWIGPlus.html | 174 +++++++++++++++++++ Examples/test-suite/python/refcount_runme.py | 33 +++- Examples/test-suite/refcount.i | 23 ++- Source/Swig/cwrap.c | 22 +-- Source/Swig/typemap.c | 16 +- 8 files changed, 262 insertions(+), 160 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index 35010d273..b59952e27 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,11 @@ See the RELEASENOTES file for a summary of changes in each release. Version 2.0.5 (in progress) =========================== +2011-08-23: wsfulton + Fix %newobject when used in conjunction with %feature("ref") as reported by Jan Becker. The + code from the "ref" feature was not always being generated for the function specified by %newobject. + Documentation for "ref" and "unref" moved from Python to the C++ chapter. + 2011-08-22: szager [python] Fixed memory leak with --builtin option (bug 3385089). diff --git a/Doc/Manual/Customization.html b/Doc/Manual/Customization.html index 7f164ac57..b98fbfc88 100644 --- a/Doc/Manual/Customization.html +++ b/Doc/Manual/Customization.html @@ -704,6 +704,11 @@ depends on the target language on implementing the 'disown' mechanism properly.

+

+The use of %newobject is also integrated with reference counting and is covered in the +C++ reference counted objects section. +

+

Compatibility note: Previous versions of SWIG had a special %new directive. However, unlike %newobject, it only applied to the next declaration. For example: diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html index fa312c4f1..78e1fbeed 100644 --- a/Doc/Manual/Python.html +++ b/Doc/Manual/Python.html @@ -38,7 +38,7 @@

  • C++ namespaces
  • C++ templates
  • C++ Smart Pointers -
  • C++ Reference Counted Objects (ref/unref) +
  • C++ reference counted objects
  • Further details on the Python class interface