add clone operation for gfx

This commit is contained in:
bunnie 2025-04-28 19:02:27 +08:00
parent e55630fd57
commit da7efec6a6

View file

@ -11,6 +11,14 @@ use crate::service::api::*;
pub struct Gfx {
conn: xous::CID,
}
impl Clone for Gfx {
fn clone(&self) -> Self {
REFCOUNT.fetch_add(1, Ordering::Relaxed);
Gfx { conn: self.conn }
}
}
impl Gfx {
pub fn new(xns: &xous_names::XousNames) -> Result<Self, xous::Error> {
REFCOUNT.fetch_add(1, Ordering::Relaxed);