LottieSharp icon indicating copy to clipboard operation
LottieSharp copied to clipboard

App crashes when switching between view because of SharpDX

Open NikasZalias opened this issue 5 years ago • 8 comments

Describe the bug Switching between views application crashes. Sometimes it takes just to go to another view to make app crash. The error is from SharpDX.

SharpDX.SharpDXException: 'HRESULT: [0x88990012], Module: [SharpDX.Direct2D1], ApiCode: [D2DERR_WRONG_FACTORY/WrongFactory], Message: Objects used together must be created from the same factory instance.

To Reproduce

  1. Load app (when animation starts)
  2. Go to another view (closes main view)
  3. Open main view again.
  4. BAM! Crash!

Expected behavior Animation should not make app crash and after returning to main view I should see working animation again.

Screenshots image

Desktop (please complete the following information):

  • OS: Version 10.0.17763 Build 17763
  • Browser Brave
  • Version Version 0.58.21 Chromium: 71.0.3578.98 (Official Build) (64-bit)

Smartphone (please complete the following information):

Additional context Could someone please explain me where is the problem? I would be nice to have working lottie lib on wpf. What could be done to overcome this problem?

NikasZalias avatar Jan 31 '19 16:01 NikasZalias

@NikasZalias I tried to reproduce it and I didn't success. I tried with tab page and also i tried with custom user control to hide and show it. result was good.

OmidID avatar Feb 04 '19 07:02 OmidID

@NikasZalias Could you provide a small test application or maybe adapt the sample application, so we can reproduce it?

Crayjin avatar Feb 04 '19 09:02 Crayjin

To me sounded like he is using something like Prism

quicoli avatar Feb 07 '19 17:02 quicoli

Googling about that exception I found: this

quicoli avatar Feb 07 '19 17:02 quicoli

Currently I using the library in a Prism base project. Actually we have full screen mode progress bar and we loading that using Prism Region

OmidID avatar Feb 07 '19 18:02 OmidID

They might be something else that's triggering that, I had that error but it wasn't this lib's fault, instead it was because of me changing the style of the button the animation was in.

Azyyyyyy avatar Apr 15 '19 15:04 Azyyyyyy

The same problem. I create a test application. Three times click on the button and throws an exception on line 408 BitmapCanvas.cs : SharpDX.SharpDXException: "HRESULT: [0x88990012], Module: [SharpDX.Direct2D1], ApiCode: [D2DERR_WRONG_FACTORY/WrongFactory]"

https://drive.google.com/open?id=1c__KBPMke7VvthF-911OMa974A29osDX

ovchinnikovas avatar Sep 16 '19 14:09 ovchinnikovas

I am also able to reproduce the issue by multiple hiding/activating WPF view with Lottie component. I've not encountered the issue with version 1.0.0.0. Issue's appeared since using latest version, but was able to reproduce it on any newer version than 1.0.0.0

KubaNemec avatar Oct 16 '20 10:10 KubaNemec