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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-04-20 17:15:11 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-04-20 17:19:49 +0300
commit02213b867ed68a00683fa931ebce12a23ed3e77b (patch)
tree3cf74a5799da5f7106b4a2d2aa0eca23b9a56747 /intern/cycles/render/session.cpp
parente3544c9e28eded2403613d2bc5af8992c3aa734a (diff)
Cycles: Stop rendering when bad_alloc happens
This is an attempt to gracefully handle out-of-memory events and stop rendering with an error message instead of a crash. It uses bad_alloc exception, and usually i'm not really fond of exceptions, but for such limited use for errors from which we can't recover it should be fine. Ideally we'll need to stop full Cycles Session, so viewport render and persistent images frees all the memory, but that we can support later, since it'll mainly related on telling Blender what to do. General rules are: - Use as less exception handles as possible, try to find a most geenric pace where to handle those. For example, ccl::Session. - Threads needs own handling, exception trap from one thread will not catch exceptions from other threads. That's why BVH build needs own thing. Reviewers: brecht, juicyfruit, dingto, lukasstockner97 Differential Revision: https://developer.blender.org/D1898
Diffstat (limited to 'intern/cycles/render/session.cpp')
-rw-r--r--intern/cycles/render/session.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index 24f48b61349..63037311889 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -816,7 +816,7 @@ void Session::update_scene()
/* update scene */
if(scene->need_update()) {
progress.set_status("Updating Scene");
- scene->device_update(device, progress);
+ MEM_GUARDED_CALL(&progress, scene->device_update, device, progress);
}
}