mirror of
https://github.com/xcat2/xNBA.git
synced 2025-01-20 14:33:15 +00:00
[image] Revert "clear LOADED flag" patch
Clearing the LOADED flag actually prevents users from doing clever things such as loading an image, then loading a patch image, then executing the first image. (image_exec() checks for IMAGE_LOADED, so this sequence of operations will fail if the LOADED flag gets cleared.) This reverts commit 14c080020fb37cb34fe74213393f47bd2ad8b9bc.
This commit is contained in:
parent
14c080020f
commit
4f2861a376
@ -156,7 +156,7 @@ void unregister_image ( struct image *image ) {
|
||||
struct image * find_image ( const char *name ) {
|
||||
struct image *image;
|
||||
|
||||
for_each_image ( image ) {
|
||||
list_for_each_entry ( image, &images, list ) {
|
||||
if ( strcmp ( image->name, name ) == 0 )
|
||||
return image;
|
||||
}
|
||||
@ -172,21 +172,12 @@ struct image * find_image ( const char *name ) {
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int image_load_type ( struct image *image, struct image_type *type ) {
|
||||
struct image *tmp_image;
|
||||
int rc;
|
||||
|
||||
/* Check image is actually loadable */
|
||||
if ( ! type->load )
|
||||
return -ENOEXEC;
|
||||
|
||||
/* Clear the loaded flag on all images; loading this image
|
||||
* will invalidate any previous loads. (Even if loading
|
||||
* fails, the previously loaded image may still have been
|
||||
* partially overwritten.)
|
||||
*/
|
||||
for_each_image ( tmp_image )
|
||||
tmp_image->flags &= ~IMAGE_LOADED;
|
||||
|
||||
/* Try the image loader */
|
||||
if ( ( rc = type->load ( image ) ) != 0 ) {
|
||||
DBGC ( image, "IMAGE %p could not load as %s: %s\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user