From: <and...@us...> - 2009-11-24 18:43:59
|
Revision: 10627 http://plplot.svn.sourceforge.net/plplot/?rev=10627&view=rev Author: andrewross Date: 2009-11-24 18:43:49 +0000 (Tue, 24 Nov 2009) Log Message: ----------- Bug with next_stream recently fixed for C++ bindings also applies to java bindings. Modified Paths: -------------- trunk/bindings/java/PLStream.java Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2009-11-23 21:54:09 UTC (rev 10626) +++ trunk/bindings/java/PLStream.java 2009-11-24 18:43:49 UTC (rev 10627) @@ -34,27 +34,27 @@ // Class data. int stream_id = -1; - static int next_stream = 0; static int active_streams = 0; // Constructor public PLStream() { + int[] strm = new int[1]; + // If this is the first instance of the class we // need to load the C part of the bindings if (active_streams == 0) { openlib(); } - stream_id = next_stream; - active_streams++; - next_stream++; - // Create stream and check it worked ok. - if(set_stream() == -1) { + plplotjavac.plmkstrm(strm); + if (strm[0] != -1) { + stream_id = strm[0]; + active_streams++; + } + else { System.err.println("Error creating plplot stream"); stream_id = -1; - active_streams--; - next_stream--; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |