summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkyren <kerriganw@gmail.com>2018-03-06 06:23:04 -0500
committerkyren <kerriganw@gmail.com>2018-03-06 06:23:04 -0500
commit1e76de1d084de6c20e6e92bb600be62202e88fb4 (patch)
treeb3eff0e27ee3da1215dc37c859cd4d0c761fffe0 /src
parenteb154e4a9ebc7997cc74bdabe7ac5705f512d0ad (diff)
downloadmlua-1e76de1d084de6c20e6e92bb600be62202e88fb4.zip
Update docs to include warning about RegistryKey in callbacks
Diffstat (limited to 'src')
-rw-r--r--src/types.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/types.rs b/src/types.rs
index 8ab85c3..4b09f24 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -24,10 +24,11 @@ pub struct LightUserData(pub *mut c_void);
/// difficult to use than the normal handle types, it is Send + Sync + 'static, which means that it
/// can be used in many situations where it would be impossible to store a regular handle value.
///
-/// Be warned, If you place this into Lua via a `UserData` type, it is *very easy* to accidentally
-/// cause reference cycles that the Lua garbage collector cannot resolve. Instead of placing a
-/// `RegistryKey` into a `UserData` type, prefer instead to use `UserData::set_user_value` /
-/// `UserData::get_user_value`.
+/// Be warned, If you place this into Lua via a `UserData` type or a rust callback, it is *very
+/// easy* to accidentally cause reference cycles that the Lua garbage collector cannot resolve.
+/// Instead of placing a `RegistryKey` into a `UserData` type, prefer instead to use
+/// `UserData::set_user_value` / `UserData::get_user_value`, and instead of moving a RegistryKey
+/// into a callback, prefer `Lua::scope`.
pub struct RegistryKey {
pub(crate) registry_id: c_int,
pub(crate) unref_list: Arc<Mutex<Option<Vec<c_int>>>>,