mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-25 07:06:12 +00:00
Refcount entries in snapshot context, moving towards sharing
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
//! Initialization routines that are used by more than one Rojo command or
|
//! Initialization routines that are used by more than one Rojo command or
|
||||||
//! utility.
|
//! utility.
|
||||||
|
|
||||||
use std::path::Path;
|
use std::{path::Path, sync::Arc};
|
||||||
|
|
||||||
use rbx_dom_weak::RbxInstanceProperties;
|
use rbx_dom_weak::RbxInstanceProperties;
|
||||||
|
|
||||||
@@ -41,7 +41,8 @@ pub fn start<F: VfsFetcher>(
|
|||||||
// If the project file defines no plugins, then there's no need to
|
// If the project file defines no plugins, then there's no need to
|
||||||
// initialize the snapshot plugin context.
|
// initialize the snapshot plugin context.
|
||||||
if !project.plugins.is_empty() {
|
if !project.plugins.is_empty() {
|
||||||
snapshot_context.plugin_context = Some(SnapshotPluginContext::new(&project.plugins));
|
snapshot_context.plugin_context =
|
||||||
|
Some(Arc::new(SnapshotPluginContext::new(&project.plugins)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
use std::{fmt, fs, ops::Deref, path::Path};
|
use std::{fmt, fs, ops::Deref, path::Path, sync::Arc};
|
||||||
|
|
||||||
use rlua::{Lua, RegistryKey};
|
use rlua::{Lua, RegistryKey};
|
||||||
|
|
||||||
use super::error::SnapshotError;
|
use super::error::SnapshotError;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct InstanceSnapshotContext {
|
pub struct InstanceSnapshotContext {
|
||||||
/// Holds all the state needed to run user plugins as part of the snapshot
|
/// Holds all the state needed to run user plugins as part of the snapshot
|
||||||
/// process.
|
/// process.
|
||||||
///
|
///
|
||||||
/// If this is None, then plugins should not be evaluated at all.
|
/// If this is None, then plugins should not be evaluated at all.
|
||||||
pub plugin_context: Option<SnapshotPluginContext>,
|
pub plugin_context: Option<Arc<SnapshotPluginContext>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for InstanceSnapshotContext {
|
impl Default for InstanceSnapshotContext {
|
||||||
|
|||||||
Reference in New Issue
Block a user