Comments (6)
Thanks for the post :). I've briefed in the last thread. Hopefully that will help you with your issue but if not, feel free to discuss more with us.
Thanks,
Limin Zhu
Chakra, Microsoft
from chakra-samples.
Thank you. The solution worked for us.
from chakra-samples.
Hi,
There still seems to be an access violation when I enable finalizer callback when creating external object. when I pass "null" in place of finalizer callback, there is no access violation.
JavaScriptValue.CreateExternalObject(new IntPtr(objId), null);// no access viloation
JavaScriptValue.CreateExternalObject(new IntPtr(objId), ExternalCustomObjectFinalizeCallback);//access violation
public static void onExternalCustomObjectFinalizeCallback(IntPtr data)
{
//notifying the c# about the object to be collected
}
Is it again a case of garbage collection? If so, how do we avoid it?
from chakra-samples.
It's possible that ExternalCustomObjectFinalizeCallback is collected by GC. Can you try adding the line to hold on to the finalize callback,
public static readonly JavaScriptObjectFinalizeCallback finalizeDelegate = ExternalCustomObjectFinalizeCallback;
And pass finalizeDelegate to CreateExternalObject?
from chakra-samples.
This seems to do the trick for the most part. I am still looking into a particular scenario which could result in access violation. I will get back if the issue persists.
from chakra-samples.
That was all. I did not encounter any more AVs. Thanks a lot.
from chakra-samples.
Related Issues (20)
- Adding items to a JS array using CallFunction doesn't add HOT 1
- Add ref to task in PromiseContinuationCallback HOT 1
- Details on .NET memory management requirements/gotchas HOT 3
- how to use third party js library? HOT 3
- Debugger (Local window) crashes when JavaScriptPropertyId is a local variable
- Enable beta features HOT 2
- Multi-thread code samples request HOT 6
- Any plan to support OSX in "JSRT Hosting Samples" HOT 1
- Linux_OSX_Shared/Sample.cpp Build Error HOT 4
- Unable to run the sample app in Linux HOT 4
- Updated helloWorld.py HOT 3
- C# Sample Updates HOT 3
- Generate a Class and Instance in C# HOT 1
- Q: TypeScript ? is it possible HOT 3
- Reuse parsing result HOT 1
- JsProjectWinrtNamespace sample not working in UWP Library
- Need help with C# Native.JsRunScript and async
- Linux/MacOS create function with return sample
- Move CharkaCore samples to chakra-core org
- This repo is missing important files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chakra-samples.