Commit graph

17,265 commits

Author SHA1 Message Date
Karl Wette
a93d5eac4e Octave: turn on autodoc in examples, so that feature is tested 2014-10-04 13:28:46 +02:00
Karl Wette
5c07625d05 Octave: ignore test suite generated files 2014-10-04 13:28:46 +02:00
Karl Wette
0d16b19122 Octave: remove '\' line continuation in director_detect_runme.m
- Deprecated in Octave 3.8.1
2014-10-04 13:28:46 +02:00
Oliver Buchtala
0a110e5138 Merge branch 'master' of https://github.com/swig/swig
Conflicts:
	CHANGES.current
2014-09-30 22:21:24 +02:00
Oliver Buchtala
08c8df5fdd Announced changes after merging #195 and #216. 2014-09-30 22:20:06 +02:00
Ian Lance Taylor
0d6cebc7c4 [Go] In configure script, require Go 1.1 or later. 2014-09-30 12:42:21 -07:00
William S Fulton
af1093d956 Add changes note for #207
[skip ci]
2014-09-30 20:37:14 +01:00
William S Fulton
412d9813f9 Typo fix in Android docs
[skip ci]
2014-09-30 20:29:17 +01:00
William S Fulton
a06dff17ad Merge pull request #207 from johan-hake/johanhake/fix-206-swig-relative-import
Fix issue with relative import when using single header file import [Python]
2014-09-30 20:22:55 +01:00
Oliver Buchtala
53d7fc8a16 Merge branch 'Richie765-master'
Conflicts:
	CHANGES.current
2014-09-30 18:46:25 +02:00
Richard
00457b6599 Making generated code more readable 2014-09-30 12:33:49 -03:00
Oliver Buchtala
6bd8e9f2c8 Merge branch 'zittix-patch-1' 2014-09-30 17:02:30 +02:00
Oliver Buchtala
2f26948ac5 Merge branch 'patch-1' of git://github.com/zittix/swig into zittix-patch-1 2014-09-30 17:02:14 +02:00
Johan Hake
de4f30bd3c Small fixes to the relative import fix.
-- Now the tests actually runs
  -- Corrected the syntax for the fix in the yacc file
2014-09-29 17:37:41 +02:00
William S Fulton
f81042057b Add changes note for #208 - array_functions initialisation 2014-09-27 16:55:46 +01:00
William S Fulton
54118d1d61 Merge branch 'tsuna-master'
* tsuna-master:
  Initialize C++ arrays created by array_functions' new_foo().
2014-09-27 16:51:47 +01:00
William S Fulton
a9ff9ab2b9 Add changes note for #187 - Ruby data sharing fix 2014-09-27 15:14:14 +01:00
William S Fulton
1fea434400 Merge branch 'lefticus-ruby_macos_static_data_conflicts'
* lefticus-ruby_macos_static_data_conflicts:
  Fix shared data problem on MacOS 10.9 with xcode 5.1
2014-09-27 15:12:04 +01:00
William S Fulton
d03ff2b262 Changes note for #168 - JNI leak fix 2014-09-27 14:48:13 +01:00
William S Fulton
0d34a0f0bf Merge branch 'pingany-director_local_jstring_leak'
* pingany-director_local_jstring_leak:
  Use more conventional naming for generated Java LocalRefGuard variables
  Make more use of LocalRefGuard in Java
  fixup! Patch of http://sourceforge.net/p/swig/mailman/message/29816385
  Patch of http://sourceforge.net/p/swig/mailman/message/29816385
2014-09-27 14:33:31 +01:00
William S Fulton
f4964f5fb3 Use more conventional naming for generated Java LocalRefGuard variables 2014-09-27 14:32:03 +01:00
William S Fulton
2f5bf397ae Make more use of LocalRefGuard in Java 2014-09-27 13:56:11 +01:00
Ian Lance Taylor
4b64ce71a3 [Go] Adjust generated code to work with upcoming Go 1.4 release. 2014-09-25 12:10:11 -07:00
Thomas Maslach
de6b433cb1 Fix Python crash when using -threads iterating containers
Also fixes li_std_vector_enum testcase when run with -threads.

Patch supplied on swig-devel mailing list on 12 Sep with details...

==============================================
I just wanted to mention that I found a crash issue in bug..

I am using SWIG 2.0.11 with python and have –threads enabled.  I have a C++ std::vector that I instantiate in SWIG with %template.  I also have a method in a class that returns this vector.  I also include std_vector.i, btw..

When I iterate like so:

children = Action.getActionList()
for child in children:
  pass

Everything is fine..

When I iterate like this:

for child in Action.getActionList()
  pass

Product crashes.

The problem is the following.  This code gets called first:

SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject * obj0 = 0 ;

  if(!PyArg_UnpackTuple(args,(char *)"delete_SwigPyIterator",1,1,&obj0)) SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SwigPyIterator" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
  }
  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
  {
    SWIG_PYTHON_THREAD_BEGIN_ALLOW;
    delete arg1;
    SWIG_PYTHON_THREAD_END_ALLOW;
  }
  resultobj = SWIG_Py_Void();
  return resultobj;
fail:
  return NULL;
}

Note the SWIG_PYTHON_THREAD_BEGIN_ALLOW/END_ALLOW. In between those two statements, we delete arg1.  That in turn will eventually end up in this code:

namespace swig {
  class SwigPtr_PyObject {
  protected:
    PyObject *_obj;

  public:
    … snip! …
    ~SwigPtr_PyObject()
    {
      Py_XDECREF(_obj);
    }

Uh-oh!  We call Py_XDECREF when we aren’t supposed to because we are in a SWIG_PYTHON_THREAD_BEGIN_ALLOW/END_ALLOW section!

This takes care of the issue:

namespace swig {
  class SwigPtr_PyObject {
  protected:
    PyObject *_obj;

  public:
    … snip! …
    ~SwigPtr_PyObject()
    {
      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
      Py_XDECREF(_obj);
      SWIG_PYTHON_THREAD_END_BLOCK;
    }

There are several other methods in this class that use the Python API, but don’t have the BEGIN/END block defined.  I’m not sure if they are required for all of them, but I believe they are..

I have attached a modified pyclasses.swg with what I believe are the correct changes.  This code is from 2.0.11, but as far as I can tell, it’s the same as what is in 3.0.2…

Apologies for not doing more here (making/running tests, getting it in the code repository, etc..), but I’m under some pressure to get some unrelated things done…
2014-09-23 22:33:25 +01:00
William S Fulton
783e816d89 Testcase warning suppression 2014-09-23 19:54:13 +01:00
William S Fulton
15152596f2 Change file for #228 and #229 2014-09-17 22:19:07 +01:00
Richard Pastrick
11d07bb45b add bool array type to arrays_csharp.i [issue #228] 2014-09-17 22:17:36 +01:00
William S Fulton
fea2fc137e Suppress Octave failing the build
li_std_vector testcase causing g++ internal compiler error
2014-09-16 19:19:48 +01:00
William S Fulton
8128b1e12f For Android examples, replace hard coded tool names with those detected at configure time. 2014-09-15 19:44:18 +01:00
Ian Lance Taylor
39433f12e4 Fix one case where we test goout rather than has_goout. The effect
was to incorrect use a return statement before the goout typemap
code.
2014-09-12 17:46:21 -07:00
Olly Betts
1a99212c2c [PHP] Add support for specifying any PHP interfaces a wrapped class
implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator";
2014-09-12 12:48:37 -03:00
Olly Betts
e12322df86 [PHP] Fix throwing a PHP exception through C++ from a subclassed
director method - PHP NULL gets returned by the subclassed method
in this case, so the directorout typemap needs to allow that (at
least if an exception is active).
2014-09-11 13:09:08 -03:00
Olly Betts
fa94a29df4 Fix comment typo 2014-09-11 13:06:17 -03:00
Ian Lance Taylor
06b1157470 Make sure to give all parameters a local before adding all the new
typemaps.

Also mark C functions compiled by 6c and friends as nosplit.
2014-09-10 16:17:54 -07:00
Ian Lance Taylor
acaaa0f31f [Go] Add goargout typemap. 2014-09-09 11:28:04 -07:00
Olly Betts
0dd7b61c57 Fix segmentation faults with directors in PHP >= 5.4 2014-09-09 13:39:30 -03:00
Richard
0dfc1b090f Fix duplicate symbol linker errors for Javascript/v8 2014-09-09 10:08:30 -03:00
Ian Lance Taylor
be145043df Add run test case for argout.i. 2014-09-07 15:44:12 -07:00
Ian Lance Taylor
1addbb46a8 [Go] Add imtype, goin, goout, godirectorin, and godirectorout
typemaps, to support writing Go code to convert between types.
2014-09-05 17:54:19 -07:00
Olly Betts
6eaec9ce7c Update expected output for pp_constant error test 2014-09-04 09:29:20 -03:00
Olly Betts
b9fe7b5f00 Disable case in pp_constant.i which never actually worked 2014-09-03 17:18:11 -03:00
Olly Betts
d3b3ff2c78 Fix comment typo 2014-09-02 23:12:35 -03:00
Olly Betts
926fd75878 Additional fixes for #218. 2014-09-02 23:12:09 -03:00
Olly Betts
f3a6c55929 [Python] Fix regression in indentation of python code produced with -modern,
introduced by changes in #188.  Reported by fabiencastan in #218.
2014-09-02 02:34:01 -03:00
Olly Betts
255c929c56 Issue an error for unknown SWIG preprocessor directives, rather
than quietly ignoring them.  Reported by jrhelsey in issue#217.
2014-09-01 00:26:15 -03:00
Olly Betts
14c2cf3407 PHP: Fix memory leak if a director method is passed Null for self 2014-08-29 16:28:00 -03:00
Richard
199d29f110 Added missing tag 2014-08-29 12:20:40 -05:00
Richard
911fd761b0 Minor improvements 2014-08-28 19:46:52 -05:00
Richard
728f540038 Added work on Javascript V8 2014-08-28 19:46:52 -05:00
Richard
a3946e1520 Remove unneeded parameter 2014-08-28 19:46:52 -05:00