Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 06-12-2017, 02:47 PM   #1
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 1,764
Default Closing Reaper with script running data bug? Solved - please ignore - my fault.

I'm having issues with saving data when Reaper is closed and my script running.

The atexit function is being called - but when my script goes to save the data it seems all the data has already been reset to default (deleted). So the save routine saves none of the data and overwrites any good data previously saved.

This doesn't happen when closing the script window manually - which should be running the same atexit routines - so I'm guessing at this stage that Reaper is clearing the script data before the save routines are run when closing Reaper with the script running.
__________________
Projects - Reascripts - Lua:
LBX Stripper | LBX Chaos Engine
Donate via Paypal

Last edited by lb0; 06-12-2017 at 11:48 PM.
lb0 is online now   Reply With Quote
Old 06-12-2017, 03:48 PM   #2
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 1,764
Default

Hmmm. Ok - my first basic test to check if this is in fact was occurring did not yield the results I expected.

I shall revisit my save routines and test further - so for the moment please ignore this thread.
__________________
Projects - Reascripts - Lua:
LBX Stripper | LBX Chaos Engine
Donate via Paypal
lb0 is online now   Reply With Quote
Old 06-12-2017, 04:18 PM   #3
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 1,764
Default

A little further testing...

It seems that maybe Reaper is unloading the tracks as my save routine runs - and this may suggest data is being removed as the script saves...

My test so far is that at the beginning of the atexit routine I'm writing to a test file certain table counts, and then again after the save routine...

My test file reads:

---before save routine is run
[strips]3
[snapshots]3
[tracks]1
---after save routine is run
[strips]1
[snapshots]1
[tracks]0
---reaper exits

at this point my save data has been reduced to a single table of strip data written (the MASTER channel data).

I'm pretty sure my save routines are not deleting this data - otherwise in normal use - I'd be losing data...

Might there actually be a problem here??

EDIT:

Added more tracks - same results when quitting Reaper:

[strips]7
[snapshots]7
[tracks]6
--after
[strips]1
[snapshots]1
[tracks]0

but when closing my script manually (Reaper stays open)

[strips]7
[snapshots]7
[tracks]6
[strips]7
[snapshots]7
[tracks]6

- which is what it should be...

Any thoughts...? Is there any way of preventing Reaper unloading data until all scripts are terminated completely?
__________________
Projects - Reascripts - Lua:
LBX Stripper | LBX Chaos Engine
Donate via Paypal

Last edited by lb0; 06-12-2017 at 04:34 PM.
lb0 is online now   Reply With Quote
Old 06-12-2017, 11:47 PM   #4
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 1,764
Default

Aah - the wonders of a good sleep.

I think I've sussed it. When Reaper closes - it deletes all the tracks before closing the scripts.

When saving my script does a clean up - so does actually delete data if it cannot find the track the data is associated with.

So it's my fault - and if I don't run the cleanup on a quit save - then we should be all good (I hope - this all came to me whilst trying to get to sleep last night - but I've not yet looked to the code to confirm)...

So please ignore this thread and a thousand apologies for not realizing what's going on in my code (again!) !!
__________________
Projects - Reascripts - Lua:
LBX Stripper | LBX Chaos Engine
Donate via Paypal
lb0 is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.