torshy/torshify — Issue #4: System.AccessViolationException when loading Starred playlist using session.FromLink()
Author: sekotin
Created: 2012-01-09 16:05:07+00:00
State: open

Hi mate,

I'm having a problem loading Starred playlist through session.FromLink(starredPlaylistURI)

What I get is:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Torshify.Core.Native.Spotify.sp_playlist_add_callbacks(IntPtr playlistPtr, PlaylistCallbacks& callbacksPtr, IntPtr userdataPtr)
at Torshify.Core.Native.NativePlaylistCallbacks..ctor(NativePlaylist playlist, Boolean registerCallbacks)
at Torshify.Core.Native.NativePlaylist.Initialize()
at Torshify.Core.Managers.PlaylistManager.Get(ISession session, IntPtr handle)
at Torshify.Core.Native.NativePlaylistLink.b__0()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at Torshify.Core.Native.NativePlaylistLink.get_Object()
at Torshify.Core.Native.NativePlaylistLink.Torshify.ILink.get_Object()

The code I'm using is:

ILink link = session.FromLink(URI);

if (link is ILink)
{
IPlaylist result = ((ILink)link).Object;
....
}

The URI is spotify:user:myusername:playlist:0000000000000000000000

Am I doing something wrong or is there a problem in Torshify?