Bonjour

Je travail sur un lecteur audio en C# 4.0 en utilisant la librairie FMod 4.30.03 (dernière version stable) 32 bits.

Jusqu'a maintenant tout fonctionnait parfaitement, mais depuis que j'ai remplacé ma ListBox contenant ma playlist par un usercontrol WPF dans ma WinForm il m'arrive des AccessViolationException.

De façon aléatoire, jamais sur la même piste, ect... l'exception est levée lors de l'appel de la méthode release(), qui sert je le rappel à libérer un channel alloué.

Je soupçonne l'usercontrol, car
- si je ne bind pas le datacontext de mon controle avec ma liste ObservableCollection<MyObj>
- si je cache mon controle "monwpf.Visible = false;"
- si je ne fais pas dériver ma classe MyObj par INotifyPropertyChange
- si je n'élève aucun évènement PropertyChanged
une seule de ces actions ne fera plus planter release par une violation d'accès de mémoire...

Si quelqu'un a une idée, moi je sèche

Voici ma stack:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
   at FMOD.Sound.FMOD_Sound_Release(IntPtr sound)
   at FMOD.Sound.release() in R:\Programming\Visual Studio 2008\Projects\Baud Player 3\Baud Player 3\fmod.cs:line 3077
   at Baud_Player_3.MP3Form.PlayHelper(Object song) in R:\Programming\Visual Studio 2008\Projects\Baud Player 3\Baud Player 3\MP3.cs:line 1825
   at Baud_Player_3.MP3Form.<>c__DisplayClass18.<PlayHelper>b__17() in R:\Programming\Visual Studio 2008\Projects\Baud Player 3\Baud Player 3\MP3.cs:line 1761
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at Baud_Player_3.Program.Main() in R:\Programming\Visual Studio 2008\Projects\Baud Player 3\Baud Player 3\Program.cs:line 20
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
[edit]
On va me le demander, voici la seule propriété qui émet un évènement:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
        public short _playedCount;
        public short playedCount
        {
            get { return _playedCount; }
            set
            {
                _playedCount = value;
                NotifyPropertyChanged("playedCount");
            }
        }
[/edit]
Si quelqu'un a une idée...