Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
imaxs committed Feb 17, 2022
1 parent 9621d4f commit a326b5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions HTMLconvert/HTMLconvert.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<RepositoryUrl>https://github.com/imaxs/HTMLconvert</RepositoryUrl>
<RepositoryType></RepositoryType>
<PackageReleaseNotes></PackageReleaseNotes>
<Version>1.0.1</Version>
<FileVersion>1.0.1</FileVersion>
<AssemblyVersion>1.0.1</AssemblyVersion>
<PackageVersion>1.0.1</PackageVersion>
<Version>1.0.2</Version>
<FileVersion>1.0.2</FileVersion>
<AssemblyVersion>1.0.2</AssemblyVersion>
<PackageVersion>1.0.2</PackageVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand Down
12 changes: 10 additions & 2 deletions HTMLconvert/ImageTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public int SetGlobalSetting(IntPtr settings, string name, string value)
{
IntPtr ptrName = Marshal.StringToHGlobalAnsi(name);
IntPtr ptrValue = Marshal.StringToHGlobalAnsi(value);

try
{
return WkHtmlTox.wkhtmltoimage_set_global_setting(settings, ptrName, ptrValue);
Expand Down Expand Up @@ -98,7 +98,15 @@ public IntPtr CreateConverter(IntPtr globalSettings)

public IntPtr CreateConverter(IntPtr globalSettings, string htmlContent)
{
return WkHtmlTox.wkhtmltoimage_create_converter(globalSettings, Marshal.StringToHGlobalUni(htmlContent));
var data = ToPointer(htmlContent);
try
{
return WkHtmlTox.wkhtmltoimage_create_converter(globalSettings, data);
}
finally
{
ClearPointer(data);
}
}

public void DestroyConverter(IntPtr converter)
Expand Down

0 comments on commit a326b5a

Please # to comment.