justin = { main feed , music , code , askjf , pubkey };
Ask Justin Frankel
No reasonable question unanswered since 2009!

Suggested topics: programming, music, sleep, coffee, etc.

Note: please do not ask questions about REAPER features, bugs or scheduling, use the forums instead.


Name: Ask: Human (enter yes):
[back to index] | [unreplied] | [replied] | [recent comments] | [all]

Question: Sometimes, when i have saved GUID* of track somewhere => then i delete that track => GUID* now points to restricted area with unknown data => trying to get access it (e.g. for comparing or guidtostring func) crashes REAPER (acces violation), what do you do in such cases, how do you check is GUID is still valid without crashing?
Asked by Pony (78.152.169.x) on September 30 2019, 1:16pm
Reply on September 30 2019, 2:37pm:
    Don't save the GUID pointer, copy the value out instead.


Comments:
  • Posted by Pony (78.152.169.x) on September 30 2019, 2:51pm:
    Then it's probably will be slow, if i need to save/remove/process a lot of manipulations with tracks. But if it's the only option, ok ,thanks.

  • Posted by Justin on September 30 2019, 3:02pm:
    Copying the value is copying 16 bytes of memory, which is basically free.

  • Posted by Pony (94.230.200.x) on September 30 2019, 3:33pm:
    For some reason i thought it's 64 bytes, just checked right now and it's 16, stupid me. I'll do as You say. I realize i need to redo thousands of code, haha... oh,no...

  • Posted by Justin on September 30 2019, 4:19pm:
    Even 64 bytes is pretty small and fast, if you manage your allocations right. If you have 1000 tracks that's 64kb, which is TINY. :)


Comment:
    Your Name:   -- Site Owner's Name:  (for human-verification)

    Comment:    

    
  
[back to index] | [unreplied] | [replied] | [recent comments] | [all]
Copyright 2019 Justin Frankel. | RSS