You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi have logic where i am calling winspool.Drv DocumentProperties method to open the Printer properties dialog. I have a c# .net DLL from where winspool.Drv DocumentProperties extern method gets called and printer properties dialog opened successfully.
But after successive calling of that method , machines CPU usage gets high and remains high till i close my electron-edge application. i am having Windows 10 64 bit 16GB RAM.
When i am calling this method WMI Host provider application gets launched and start consuming memory. Also on some other machine Windows 10 64 bit 8 GB RAM ,System.Management Quota Violation exception get thrown after successive calls(5-6 times) to that method.
So some how memory leak is there , which i don't understand. Please help me to find out the solution.
handle.OpenPrintDialog(printerData, function (err, res) {
if (err)
deferred.reject(err);
else
deferred.resolve(res);
handle = null;
});
In C#
InterOp pattern Startup class method called via electron-edge
public async Task Invoke(dynamic input)
{
IPrintController controller = GetPrintController(monitor);
return new
{
OpenPrintDialog = (Func<object, Task>)(
async (dynamic i) => await controller.OpenPrintDialog(Convert.ToString(i.PrinterName), Convert.ToString(i.PrintDialogSetup)))
}
}
5. middle layer to to convert passed printer settings and hand it over to main class
Hi have logic where i am calling winspool.Drv DocumentProperties method to open the Printer properties dialog. I have a c# .net DLL from where winspool.Drv DocumentProperties extern method gets called and printer properties dialog opened successfully.
But after successive calling of that method , machines CPU usage gets high and remains high till i close my electron-edge application. i am having Windows 10 64 bit 16GB RAM.
When i am calling this method WMI Host provider application gets launched and start consuming memory. Also on some other machine Windows 10 64 bit 8 GB RAM ,System.Management Quota Violation exception get thrown after successive calls(5-6 times) to that method.
So some how memory leak is there , which i don't understand. Please help me to find out the solution.
Please check the below code snippet from my code.
in Node.js
this.edge = electron.remote.require('electron-edge');
handle = this.edge.func({ assemblyFile: assemblyPath });
handle.OpenPrintDialog(printerData, function (err, res) {
if (err)
deferred.reject(err);
else
deferred.resolve(res);
handle = null;
});
In C#
public async Task Invoke(dynamic input)
{
IPrintController controller = GetPrintController(monitor);
return new
{
OpenPrintDialog = (Func<object, Task>)(
async (dynamic i) => await controller.OpenPrintDialog(Convert.ToString(i.PrinterName), Convert.ToString(i.PrintDialogSetup)))
}
}
5. middle layer to to convert passed printer settings and hand it over to main class
public async Task OpenPrintDialog(string printerName, string printDialogSetup)
{
return await PrintHelper.OpenPrintDialogAsync(printerName, printDialogSetup);
}
public class PrintHelper
{
[DllImport("kernel32.dll")]
static extern IntPtr GlobalLock(IntPtr hMem);
}
The text was updated successfully, but these errors were encountered: