mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add clone operation for gfx
This commit is contained in:
parent
e55630fd57
commit
da7efec6a6
1 changed files with 8 additions and 0 deletions
|
|
@ -11,6 +11,14 @@ use crate::service::api::*;
|
||||||
pub struct Gfx {
|
pub struct Gfx {
|
||||||
conn: xous::CID,
|
conn: xous::CID,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Clone for Gfx {
|
||||||
|
fn clone(&self) -> Self {
|
||||||
|
REFCOUNT.fetch_add(1, Ordering::Relaxed);
|
||||||
|
Gfx { conn: self.conn }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Gfx {
|
impl Gfx {
|
||||||
pub fn new(xns: &xous_names::XousNames) -> Result<Self, xous::Error> {
|
pub fn new(xns: &xous_names::XousNames) -> Result<Self, xous::Error> {
|
||||||
REFCOUNT.fetch_add(1, Ordering::Relaxed);
|
REFCOUNT.fetch_add(1, Ordering::Relaxed);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue