aboutsummaryrefslogtreecommitdiffstats
path: root/doc/c/shutting-down.rst
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-01-06 23:53:31 +0100
committerDavid Robillard <d@drobilla.net>2021-01-06 23:53:31 +0100
commitd2a6fd3f725f7f174535c49d78d07567e12c84d8 (patch)
tree8ebbe1d224363f94610e64af167a2592390787b4 /doc/c/shutting-down.rst
parent31d059bf849045f45c8c9db361efd093e88a109c (diff)
downloadpugl-d2a6fd3f725f7f174535c49d78d07567e12c84d8.tar.gz
pugl-d2a6fd3f725f7f174535c49d78d07567e12c84d8.tar.bz2
pugl-d2a6fd3f725f7f174535c49d78d07567e12c84d8.zip
Split overview into multiple documents
Diffstat (limited to 'doc/c/shutting-down.rst')
-rw-r--r--doc/c/shutting-down.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/c/shutting-down.rst b/doc/c/shutting-down.rst
new file mode 100644
index 0000000..dfb56cd
--- /dev/null
+++ b/doc/c/shutting-down.rst
@@ -0,0 +1,20 @@
+.. default-domain:: c
+.. highlight:: c
+
+#############
+Shutting Down
+#############
+
+When a view is closed,
+it will receive a :struct:`PuglEventClose`.
+An application may also set a flag based on user input or other conditions,
+which can be used to break out of the main loop and stop calling :func:`puglUpdate`.
+
+When the main event loop has finished running,
+any views and the world need to be destroyed, in that order.
+For example:
+
+.. code-block:: c
+
+ puglFreeView(view);
+ puglFreeWorld(world);