Skip to content

Commit

Permalink
This fixes https://rclr.codeplex.com/workitem/42. It has to have mean…
Browse files Browse the repository at this point in the history
…ing...
  • Loading branch information
jmp75 committed Nov 25, 2014
1 parent 010e958 commit 0c620ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
24 changes: 13 additions & 11 deletions R.NET/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ protected SymbolicExpression InvokeViaPairlist(string[] argNames, SymbolicExpres
//IntPtr result = Engine.GetFunction<Rf_applyClosure>()(Body.DangerousGetHandle(), handle,
// argPairList.DangerousGetHandle(),
// Environment.DangerousGetHandle(), newEnvironment);
IntPtr call = Engine.GetFunction<Rf_lcons>()(handle, argPairList.DangerousGetHandle());
IntPtr result = evaluateCall(call);

return new SymbolicExpression(Engine, result);
return createCallAndEvaluate(argPairList.DangerousGetHandle());
}

// http://msdn.microsoft.com/en-us/magazine/dd419661.aspx
Expand Down Expand Up @@ -115,13 +112,18 @@ protected SymbolicExpression InvokeOrderedArguments(SymbolicExpression[] args)
{
argument = this.GetFunction<Rf_cons>()(arg.DangerousGetHandle(), argument);
}
using (var call = new ProtectedPointer(Engine, this.GetFunction<Rf_lcons>()(handle, argument)))
{
using (var result = evaluateCall(call))
{
return new SymbolicExpression(Engine, result);
}
}
return createCallAndEvaluate(argument);
}

private SymbolicExpression createCallAndEvaluate(IntPtr argument)
{
using (var call = new ProtectedPointer(Engine, this.GetFunction<Rf_lcons>()(handle, argument)))
{
using (var result = evaluateCall(call))
{
return new SymbolicExpression(Engine, result);
}
}
}
}
}
2 changes: 1 addition & 1 deletion RDotNet.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>R.NET.Community</id>
<title>R.NET</title>
<version>1.5.17</version>
<version>1.5.18</version>
<releaseNotes>Under development</releaseNotes>
<authors>RecycleBin, jperraud</authors>
<owners>kos59125</owners>
Expand Down

0 comments on commit 0c620ef

Please sign in to comment.