Quantcast
Channel: Microsoft Dynamics NAV
Viewing all articles
Browse latest Browse all 64865

Forum Post: unrelased resource in page add-in

$
0
0

In a page add-in I declare and instantiate a class (bptiProxy) from a dll.

========================================================

BptiProxyClient bptiProxy;

.

.

.

if (bptiProxy == null)

 {

     bptiProxy = new BptiProxyClient();

 }

========================================================

This causes the error "Exception has been thrown by the target of an invocation" when the page is opened a second time, unless I restart the RTC in between.

The add-in class implements Idisposible and contains method dispose like this:

========================================================

       protected override void Dispose(bool disposing)

       {

           base.Dispose(disposing);

           if (disposing)

           {

               bptiProxy.Dispose();

           }

       }

========================================================

It seems like bptiProxy is not fully released until RTC is closed.

How can I solve this?

Best Regards / Håkan Svensson


Viewing all articles
Browse latest Browse all 64865

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>