Skip to content

Commit

Permalink
Only load image on non-LOADING state
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Nov 12, 2010
1 parent ae69896 commit f3d1f68
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Image.cc
Expand Up @@ -197,10 +197,12 @@ EIO_AfterLoad(eio_req *req) {

void
Image::load() {
Ref();
state = LOADING;
eio_custom(EIO_Load, EIO_PRI_DEFAULT, EIO_AfterLoad, this);
ev_ref(EV_DEFAULT_UC);
if (LOADING != state) {
Ref();
state = LOADING;
eio_custom(EIO_Load, EIO_PRI_DEFAULT, EIO_AfterLoad, this);
ev_ref(EV_DEFAULT_UC);
}
}

/*
Expand Down

0 comments on commit f3d1f68

Please sign in to comment.