Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-06-17 00:37:13 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-06-30 19:12:08 +0300
commit95ee06d068a6526ef773e2cb40420c744cf39e1e (patch)
tree6cdad6a27970d11b2ca52a9ec7331963a2b78031 /source/blender/windowmanager/intern/wm_files.c
parentd4b9b2c020de3bf78aa4277fe3ef4e3c488ac51b (diff)
Fix T77825: autosave missed too often while sculpting
Previously if a modal operator is active, which might leave Blender in a state where it's not safe to autosave, it would try again in 10s. Now try again in 10ms so it's much less likely to be missed, since overhead of such a timer is negligble anyway. Also remove the debug print that was added to investigate a bug at some point.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index d08636e826c..d5a240a358e 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1611,16 +1611,14 @@ void wm_autosave_timer(Main *bmain, wmWindowManager *wm, wmTimer *UNUSED(wt))
WM_event_remove_timer(wm, NULL, wm->autosavetimer);
- /* if a modal operator is running, don't autosave, but try again in 10 seconds */
+ /* If a modal operator is running, don't autosave because we might not be in
+ * a valid state to save. But try again in 10ms. */
LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
LISTBASE_FOREACH (wmEventHandler *, handler_base, &win->modalhandlers) {
if (handler_base->type == WM_HANDLER_TYPE_OP) {
wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base;
if (handler->op) {
- wm->autosavetimer = WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, 10.0);
- if (G.debug) {
- printf("Skipping auto-save, modal operator running, retrying in ten seconds...\n");
- }
+ wm->autosavetimer = WM_event_add_timer(wm, NULL, TIMERAUTOSAVE, 0.01);
return;
}
}