Possibly set the particle frequency to 0, then wait long enough for all the particles to disappear before deleting the emitter.
Took the example Projects\Particles\CreatingParticles\CreatingParticles.agk and modified it so that pressing the spacebar will delete the emitter gracefully
// particles
// virtual resolution
SetVirtualResolution ( 320, 480 )
// display a background
backdrop = CreateSprite ( LoadImage ( "background1.jpg" ) )
SetSpriteColorAlpha ( backdrop, 100 )
// load image for particles
LoadImage ( 1, "particle.png" )
// create a block of particles and set properties
CreateParticles ( 1, 150, 10 )
SetParticlesImage ( 1, 1 )
SetParticlesStartZone ( 1, -100, -10, 100, 10 )
SetParticlesDirection ( 1, 0, 50.0 )
SetParticlesLife ( 1, 9 )
SetParticlesSize ( 1, 24 )
SetParticlesAngle ( 1, 15 )
SetParticlesFrequency ( 1, 60 )
SetParticlesVelocityRange ( 1, 1, 4 )
AddParticlesColorKeyFrame ( 1, 0, 0, 100, 255, 0 )
AddParticlesColorKeyFrame ( 1, 0.5, 0, 100, 255, 255 )
AddParticlesColorKeyFrame ( 1, 8.0, 150, 50, 100, 255 )
AddParticlesColorKeyFrame ( 1, 9.0, 0, 0, 0, 0 )
// main loop
Time as float
Flag as integer = 0
do
//If space key is pressed, stop emitting particles
if GetRawKeyPressed(32)
SetParticlesFrequency(1,0)
//9 seconds particle life plus a few extra seconds for particles to finish fading
Time = Timer() + 12.0
Flag = 1
endif
if Flag = 1 and Timer() >= Time
Flag = 0
DeleteParticles(1)
endif
// update the screen
Sync ( )
loop