When this function is used, crashing happens.
1) get a source from an existing item
2) set this source to a new take in another item on another track
3) delete this another track
4) BUG - another item stays visible and a crash follows
The minimal code bellow. Have two items selected, the first one is with audio, the second one is an empty item.
Code:
item = reaper.GetSelectedMediaItem(0,0)
take = reaper.GetMediaItemTake( item, 0 )
source = reaper.GetMediaItemTake_Source(take)
newItem = reaper.GetSelectedMediaItem(0,1)
newTake = reaper.AddTakeToMediaItem( newItem )
reaper.SetMediaItemTake_Source( newTake, source )
reaper.TrackList_AdjustWindows( 0 )
reaper.UpdateArrange()
Win 7 x64, Reaper 5.40 x86.
Problem signature:
Problem Event Name: APPCRASH
Application Name: reaper.exe
Application Version: 5.4.0.0
Application Timestamp: 58d4503b
Fault Module Name: StackHash_0c47
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Code: c0000005
Exception Offset: 6f636e45
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1051
Additional Information 1: 0c47
Additional Information 2: 0c47ecc18b31d3b3d50c3a36f49e3b09
Additional Information 3: 1941
Additional Information 4: 1941429135e595173f524b33e4c29689