pike.git/
src/
dynamic_load.c
Branch:
Tag:
Non-build tags
All tags
No tags
2003-06-06
2003-06-06 14:30:02 by Henrik Grubbström (Grubba) <grubba@grubba.org>
4a36b2409964460dcde26d8149bc5f329455e1f9 (
36
lines) (+
28
/-
8
)
[
Show
|
Annotate
]
Branch:
7.9
load_module() is now aware of end_program() being able to return NULL.
Rev: src/dynamic_load.c:1.70
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: dynamic_load.c,v 1.
69
2003/
04
/
07
17
:
28
:
55
nilsson
Exp $
+
|| $Id: dynamic_load.c,v 1.
70
2003/
06
/
06
14
:
30
:
02
grubba
Exp $
*/ #ifdef TESTING
24:
# include "language.h" # include "lex.h"
-
RCSID("$Id: dynamic_load.c,v 1.
69
2003/
04
/
07
17
:
28
:
55
nilsson
Exp $");
+
RCSID("$Id: dynamic_load.c,v 1.
70
2003/
06
/
06
14
:
30
:
02
grubba
Exp $");
#else /* TESTING */
350:
static void cleanup_compilation(struct compilation_save *save) {
-
free_
program
(
end_program());
+
struct program *p = end
_program(
);
+
if (p) {
+
free
_program(
p
);
+
}
free_string(lex.current_file); compilation_depth = save->compilation_depth; lex = save->lex;
492:
#endif pop_n_elems(args);
-
push_
program
(
end_program()
)
;
+
{
+
struct
program
*p =
end_program();
free_string(lex.current_file); compilation_depth = save.compilation_depth; lex = save.lex;
-
+
if (p) {
+
push_program(p);
add_ref(new_module->module_prog = Pike_sp[-1].u.program);
-
+
} else {
+
/* Initialization failed. */
+
new_module->exit();
+
dlclose(module);
+
dynamic_module_list = new_module->next;
+
free(new_module);
+
if (strlen(module_name) < 1024) {
+
Pike_error("Failed to initialize dynamic module \"%s\".\n", module_name);
+
} else {
+
Pike_error("Failed to initialize dynamic module.\n");
}
-
+
}
+
}
+
}
#endif /* USE_DYNAMIC_MODULES */