Under some conditions, a gasoline-powered engine can continue to run even after the driver turns the ignition off and cuts power to the spark plug. This is called "dieseling" because diesel engine doesn't need a spark plug to run -- it just squeezes the air/fuel mixture until it heats up and explodes. Therefore, to eliminate dieseling in a gasoline engine, you need to eliminate the unwanted fuel source and hot-spots in the combustion chamber that allows the fuel to explode.
Run a carbon-cleaning solvent through your engine. Regardless of its fuel source, a gasoline engine simply cannot diesel without something to ignite the fuel. Diesel engines run without an ignition source because their extremely high compression ratios ignite the fuel by heat and pressure alone; gasoline engines use far lower compression ratios, so there must be something in the cylinder that remains hot enough to ignite the fuel. That "something" is usually excess carbon. Introducing a carbon-cleaning solvent like Seafoam, GM Top-End Cleaner or Wynn's Internal Engine Cleaner into your intake will dissolve the carbon and reduce hot-spots in the combustion chamber. Check the references and resources for tutorials on "Seafoaming" your engine.
Replace the spark plugs with "colder" heat range plugs. Odds are good that if your engine has been dieseling, the spark plugs are malfunctioning, coated in carbon and in need of replacement. "Colder" plugs have a smaller ceramic insulator that will help to keep the plug tip cooler, eliminating one potential hot spot in the combustion chamber.
Change your oil and replace it with a high-mileage full-synthetic. These oils contain seal conditioners that cause your valve stem seals to swell slightly, helping them to better seal against the valves and prevent oil intrusion into the intake port. If successful, this procedure will eliminate oil in the cylinders, which is the likely fuel source for your dieseling engine. Add a can of engine restoring engine additive containing a copper-silver-lead (CSL) suspension; these particles with melt and fill the tiny scratches in your cylinder walls, which are another source for oil intrusion.
Replace the intake-side valve stem seals. If your car continues to diesel after this, then there's a good possibility that you have a damaged piston oil-control ring. If this is the case, the engine will need a complete rebuild to replace the rings and reseal the cylinders. You may also need new pistons, since dieseling at low rpm indicates piston-damaging misfire at high rpm.
Carburetted cars are more prone to dieseling than fuel injected cars. If your carburetted car develops a dieseling problem, try adjusting the throttle-position screw to reduce airflow to the engine at idle. An air/fuel mixture that is too lean or too rich can also cause dieseling, so recheck the mixture to ensure that it's within factory spec. "Seafoaming" (the term has been made generic to describe the procedure; you don't have to use Seafoam) will do a fine job of eliminating carbon build up, but you may need to do it more than once to fully extricate the coal from your engine. You might consider keeping an anti-carbon additive like GM's Carbon-X in your fuel tank for a full month to completely eliminate all traces of carbon build-up.