mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-11-24 15:31:16 +07:00
Improve test of double references
This commit is contained in:
parent
818f8e8ad5
commit
22907a188c
@ -45,6 +45,28 @@ int main(int argc, char *argv[])
|
||||
printf("modname='%s' obj=%p\n", modname, mod2);
|
||||
|
||||
kmod_module_unref(mod1);
|
||||
kmod_module_unref(mod2);
|
||||
|
||||
/* same thing, but now unref the first module */
|
||||
|
||||
err = kmod_module_new_from_name(ctx, modname, &mod1);
|
||||
if (err < 0) {
|
||||
fprintf(stderr, "error creating module: '%s'\n", strerror(-err));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
printf("modname='%s' obj=%p\n", modname, mod1);
|
||||
|
||||
kmod_module_unref(mod1);
|
||||
|
||||
err = kmod_module_new_from_name(ctx, modname, &mod2);
|
||||
if (err < 0) {
|
||||
fprintf(stderr, "error creating module: '%s'\n", strerror(-err));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
printf("modname='%s' obj=%p\n", modname, mod2);
|
||||
|
||||
kmod_module_unref(mod2);
|
||||
kmod_unref(ctx);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user